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 non-databound grid row selection

Thread ID:

Created:

Updated:

Platform:

Replies:

6633 Aug 20,2003 02:22 PM Aug 20,2003 03:24 PM Windows Forms 1
loading
Tags: GridControl
Charles Carlin
Asked On August 20, 2003 02:22 PM

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 03:24 PM

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.

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.

;