I have an image button in an TemplateDataField of Band(0) in a WHDG.
<ig:TemplateDataField Key="ClearCol"> <ItemTemplate> <asp:ImageButton ID="ClearButton" runat="server" CommandName="CLEAR" CommandArgument='<%# Eval("Transport Order ID") %>' ImageUrl="~/images/ClearBookButton.gif" /></ItemTemplate>
I am handling the ItemCommand OK but SERVER side I want to be able to read the contents of other cells from the same row of the grid. Row selection is not enabled. How do I do that?
Hello,
Please go through the following forum thread where Alexander explains how to refer the current row in Itemcommand.
http://community.infragistics.com/forums/p/32581/181794.aspx#181794
Please let me know if you have any further questions regarding this matter.
I have been able to get the grid row back to my server code but don't know how to read the values in the grid row (either data or values in the grid)
The WebHierarchiechalDatGrid does not have a DataView like the WebDataGrid. I am struggling to find a way round GridRecordCollections and ContainerGridCollections . The documentation does not appear to match the implementation (2011.1) (e.g. The Rows property is a GridRecordCollection which the documentation says has an Item property which is a GridRecord whereas the implementation has an Items property which is a GridRecordItemCollection class)
A conceptual overview would be nice but failing that a simple example would help.
Thank you
I must apologise because I have found a conceptual overview of sorts in the "About WebHierarchicalDataGrid" section of the help. I previously ignored this because I have previously only been using the AJAX.NET controls and the equivalent sections in the help e.g. "About WebGrid" do not contain the same level of detail.
Hello Nickhoare,
I am just checking to know if you still need any further assistance from our side.
This turns out to be massively complicated. The grid does not know its pageindex on postback so you have to create a hidden field, save the pageindex in that and then when the grid is posted back you have to set the page according to the hidden field.
Fortunately others have been through that pain barrier and have produced some javascript that helps
function initGrid(grid, args) { doBackState(grid, false); } function pageChanged(grid, args) { doBackState(grid, true); } function doBackState(grid, save) { var paging = grid.get_behaviors().getBehaviorByName('Paging'); var backState = $get('gridRowIndextxt'); if (!paging || !backState) return; if (save) { backState.value = paging.get_pageIndex(); return; } var index = backState.value; if (index && index.length > 0) paging.set_pageIndex(parseInt(index)); }
Please provide details on what you are looking to accomplish. These detials will help me to know how to best approach this.
Let me know if you have any further questions regarding this matter.
I am successfully reading the row using this trick
<asp:ImageButton ID="EditButton" runat="server" ImageUrl="~/images/button-pencil.gif" CommandName="EDIT" CommandArgument='<%# DataBinder.Eval(DirectCast(Container, Infragistics.Web.UI.TemplateContainer).Item, "Row.Index") %>' />for passing the row index but using this codeNewGrid.GridView.Rows(RowIndex).Items(12).Value with the row index I always read the row of the first page. How to I get the data if I have paged to another page on the grid?Thanks