简体   繁体   English

如何在DevExpress GridView中更改行的背景颜色?

[英]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. 我的表单中有一个DevExpress GridView,由于布尔值,我需要更改一些颜色。

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: 您可以在RowStyle事件处理程序中更改行的颜色渐变:

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 请参阅: 自定义单个行和单元格的外观

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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