We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Sorting a gdbg and selected record

I have a GDBG with DataSource = a Dataview and 2 GridBoundColumns. If I sort the grid (by clicking a column) the sorting is performed, but the selected rowindex stays the same. If the actual selected row is rowindex 1, the selected row after sorting should be the last row. But it''s still rowindex 1, so that another record is now selected. I want, that the same record is selected after sorting. Greetings Falk

3 Replies

AD Administrator Syncfusion Team December 4, 2005 04:42 PM UTC

Here is a forum thread that discusses one way to handle this. http://www.syncfusion.com/Support/forums/message.aspx?MessageID=10655


AD Administrator Syncfusion Team December 5, 2005 05:46 PM UTC

I think this should be implemented in the grid - so that there is no need to make a workaround. Could this be a feature request? What''s your opinion? Greetings Falk


AD Administrator Syncfusion Team December 5, 2005 07:12 PM UTC

If you use a GridGroupingControl, the current record will be persisted through a sort. The problem with adding this supportto a GridDataDataBound is a data neutral manner is performance. In general, locating the moved currently selected item would require looping through all items in the datasource and this could be a huge number. The GridGroupingControl can easily find the moved items because of its datastructures, but the GridDataboundGrid cannot. You only the other hand, might have special knowledge of your datasource that would let you use something like DataView.Find to efficiently locate the moved item. That is why we have left this up to the user in a GridDataBoundGrid so far.

Loader.
Live Chat Icon For mobile
Up arrow icon