[英]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 请参阅: 自定义单个行和单元格的外观
You must handle RowStyle or RowCellStyle event of GridView. 您必须处理GridView的RowStyle或RowCellStyle事件。 Form more detail see http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowCellStyletopic and http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowStyletopic .
表单更多详细信息,请参阅http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowCellStyletopic和http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowStyletopic 。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.