简体   繁体   中英

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 ??

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM