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

DataBoundGrid - how to preserve selected rows when binding context position changes

Thread ID:





6064 Jul 30,2003 07:14 AM UTC Jul 30,2003 08:00 AM UTC WinForms 1
Tags: GridControl
Alexander Arlievsky
Asked On July 30, 2003 07:14 AM UTC

Hi, We are using data bound grid, and we've implemented sort of "multiple selection" - several rows can be selected, and they are painted with different colors. Grid is bounded to dataset, and when current position in binding context changes, grid "forgets" what prevuously was selected. We need to keep those rows selected. What is the best way to do it ? Alex.

Administrator [Syncfusion]
Replied On July 30, 2003 08:00 AM UTC

You would have to provide these colors dynamically in PrepareViewStyleInfo. In the handler, if e.RowIndex is points to a row you want colored, and if e.ColIndex > 0, then set e.Style.BackColor to the desired color. So, you would have to maintain a list of colored rows, and the color for each of the rows, and use this in PrepareViewStyleInfo to provide the proper color based on e.RowIndex.


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