I have a grid with a LinkButton which triggers an ItemCommand event. When the grid is ungrouped and unsorted the e.Item.ItemIndex provides the correct value. But when grouped or sorted, ItemIndex is incorrect. I've also tried DataSetIndex and RowIndex but these don't help either. Assume the datatable used to populate the grid has 30 rows and row 29 has the data of interest. Group and Sort the grid and let's say that data lands in the 2nd group, 3rd row, overall in row 12 in the grid
Given the tools available how do I get "29" so that I can go back to the data source and pull the row with that index?
And given the example above, what properties are available to return the other data: group 2, row 3 in group 2, row 12 in the grid.
Preferring to be taught how to fish rather than being given a fish, where should I have found all of this information? The tooltips in code seem to be inaccurate and the documentation isn't much more helpful.
I have already solved this problem by adding a new value into my data table, a UniqueID which is just the sequential in index of the order in which objects are added to the table. Then I added a new hidden column to the grid, and in ItemCommand I use that value converted to Int as an index on the table. This will probably be extended to use the an alphanumeric UniqueID, and then I'll use LINQ to select the record with that UniqueID. I'd rather not have to recall the entire dataset back into the code to do this.
Thanks
Given the tools available how do I get "29" so that I can go back to the data source and pull the row with that index?
And given the example above, what properties are available to return the other data: group 2, row 3 in group 2, row 12 in the grid.
Preferring to be taught how to fish rather than being given a fish, where should I have found all of this information? The tooltips in code seem to be inaccurate and the documentation isn't much more helpful.
I have already solved this problem by adding a new value into my data table, a UniqueID which is just the sequential in index of the order in which objects are added to the table. Then I added a new hidden column to the grid, and in ItemCommand I use that value converted to Int as an index on the table. This will probably be extended to use the an alphanumeric UniqueID, and then I'll use LINQ to select the record with that UniqueID. I'd rather not have to recall the entire dataset back into the code to do this.
Thanks