Renaud is Not Bill Gates
Renaud is Not Bill Gates

Reputation: 2084

How can I change the backcolor of a row in a DevExpress GridView?

I have a DevExpress GridView in my form and I need to change some rows color due to a boolean value.

What is the property that allows me to change the backcolor of a row ??

Upvotes: 3

Views: 13494

Answers (2)

Dennis Traub
Dennis Traub

Reputation: 51634

You can change the row's color gradient in the RowStyle event handler:

private void myGridView_RowStyle(object sender,
                       DevExpress.XtraGrid.Views.Grid.RowStyleEventArgs e) 
{
    e.Appearance.BackColor = Color.Green;
    e.Appearance.BackColor2 = Color.LightGreen;
}

See: Customizing Appearances of Individual Rows and Cells

Upvotes: 7

Related Questions