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

我的表单中有一个DevExpress GridView,由于布尔值,我需要更改一些颜色。

是什么属性允许我改变一行的背景色?

您可以在RowStyle事件处理程序中更改行的颜色渐变:

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

请参阅: 自定义单个行和单元格的外观

您必须处理GridView的RowStyle或RowCellStyle事件。 表单更多详细信息,请参阅http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowCellStyletopic和http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowStyletopic 。