问题
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 ??
回答1:
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
回答2:
You must handle RowStyle or RowCellStyle event of GridView. Form more detail see http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowCellStyletopic and http://documentation.devexpress.com/#WindowsForms/DevExpressXtraGridViewsGridGridView_RowStyletopic.
来源:https://stackoverflow.com/questions/13335135/how-can-i-change-the-backcolor-of-a-row-in-a-devexpress-gridview