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

DataBoundGrid - Changing the Style of a specific row

I''m trying to change the style of the entire row...If I have the Row index (from an event) how can I change the style of that particular row? Thanks, any help is appreciated

1 Reply

AD Administrator Syncfusion Team January 13, 2005 03:02 PM UTC

In a GridDataboundGrid, there is no property settings that you can use to ''set'' the backcolor of a row. Instead, you have to handle an event (PrepareViewStyleInfo), and in your handler, dynamically provide the color if e.RowIndex points to a row that you want to see have a specific color. So, if you have an event or something else that lets you know that row 5 should be blue, then what you have to do is to save the fact that row 5 should be blue in some manner. Then in your PrepareViewStyleInfo handler, you check e.RowIndex to see if it should be colored from your cache of row color information, and if so, you set e.Style.BackColor. See this KB link. http://64.78.18.34/Support/article.aspx?id=561

Loader.
Live Chat Icon For mobile
Up arrow icon