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. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Maintain row selection after sort

Thread ID:





74098 May 29,2008 06:57 PM UTC May 30,2008 08:15 AM UTC WinForms 1
Tags: GridControl
Sean Greer
Asked On May 29, 2008 06:57 PM UTC

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.



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

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.


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon