I am using the sorting from the samples to sort my non-database grid control. It is working fine except I would like to keep the same row selected. So if the second row moves to the first after the sort I would like the first row to be selected. Is there anyway to do this without searching thru all the rows manually to determine a match.
ADAdministrator Syncfusion Team August 20, 2003 02:24 PM
Before sorting, you could add a 'hidden' column, and in this column put a 0 or 1 to indicate that the row is selected. Then when you sort this indicator will move with the sort. So, after the sort you could loop thorugh the column to see what rows should be selected in the sorted grid.
Better yet, instead of adding the extra column, you could put the 0 or 1 in style.Tag of the row header's style object.
I don't know whether this would be more efficient of just searching through rows after the sort.