如何在DevExpress GridView中更改一行的背景颜色? [英] How can I change the backcolor of a row in a DevExpress GridView?
本文介绍了如何在DevExpress GridView中更改一行的背景颜色?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我的窗体中有一个DevExpress GridView,因为一个布尔值,我需要更改一些行颜色。
解决方案
您可以在 RowStyle $中更改行的颜色渐变c $ c>事件处理程序:
private void myGridView_RowStyle(object sender,
DevExpress.XtraGrid.Views.Grid。 RowStyleEventArgs e)
{
e.Appearance.BackColor = Color.Green;
e.Appearance.BackColor2 = Color.LightGreen;
}
请参阅:自定义个别行和单元格的外观
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
这篇关于如何在DevExpress GridView中更改一行的背景颜色?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文