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 - Changing the Style of a specific row

Thread ID:





23511 Jan 13,2005 02:55 PM UTC Jan 13,2005 03:02 PM UTC WinForms 1
Tags: GridControl
Spencer Robinson
Asked On January 13, 2005 02:55 PM UTC

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

Administrator [Syncfusion]
Replied On 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.


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