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.
Unfortunately, activation email could not send to your email. Please try again.

Sorting a gdbg and selected record

Thread ID:





38008 Dec 4,2005 10:39 AM Dec 5,2005 02:12 PM Windows Forms 3
Tags: GridControl
Administrator [Syncfusion]
Asked On December 4, 2005 10:39 AM

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

Administrator [Syncfusion]
Replied On December 4, 2005 11:42 AM

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

Administrator [Syncfusion]
Replied On December 5, 2005 12:46 PM

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

Administrator [Syncfusion]
Replied On December 5, 2005 02:12 PM

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.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.