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

Sorting non-databound grid row selection

Thread ID:





6633 Aug 20,2003 06:22 PM UTC Aug 20,2003 07:24 PM UTC WinForms 1
Tags: GridControl
Charles Carlin
Asked On August 20, 2003 06:22 PM UTC

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.

Administrator [Syncfusion]
Replied On August 20, 2003 07:24 PM UTC

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.


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

Live Chat Icon For mobile
Live Chat Icon