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
close icon

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

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.

1 Reply

AD Administrator Syncfusion Team 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.

Live Chat Icon For mobile
Up arrow icon