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.

Maintain row selection after sort

Thread ID:

Created:

Updated:

Platform:

Replies:

74098 May 29,2008 02:57 PM May 30,2008 04:15 AM Windows Forms 1
loading
Tags: GridControl
Sean Greer
Asked On May 29, 2008 02:57 PM


Let's say I have a grid with 5 rows and it starts out sorted by column 1. Let's also say that the user has selected row 3 and then chooses to sort the grid by column 2. Is there any convenient way to know the row index of the data that was previously in row 3?

Here's an example:

Art Torres 33202
Bob Salas 1202
Charlie Johnson 2021
Dina Harding 7500
Ed Haslett 5202

If "Charlie Johnson" is selected and then the grid is sorted by column 2, the row containing "Charlie" will now be row 2. Is there an easy way to determine this?

The reason for asking is that I want the full-row-select to be maintained after a sort operation.

Thanks...

Sean



Administrator [Syncfusion]
Replied On May 30, 2008 04:15 AM

You did not mention which grid you were using. Selected records should be maintained automatically through a sort if you are using a GridGroupingControl. If you are using a GridDataBoundGrid, then that grid relies on the underlying IBindingList.Sort to manage the sorting and this does not include preserving selected records.

Here is a forum post that asks about preserving selections when sorting a GridDataBoundGrid.
http://www.syncfusion.com/support/forums/message.aspx?MessageID=74058



CONFIRMATION

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.

;