Handle the GridView.RowCellStyle event to customize appearance settings of cells based on a specific condition.
This example demonstrates how to create a helper class that handles the RowCellStyle
event and makes it easy to specify a cell color:
private CellColorHelper _CellColorHelper;
public Form1() {
InitializeComponent();
gridControl1.DataSource = CreateTable(20);
_CellColorHelper = new CellColorHelper(gridView1);
}
private void simpleButton1_Click(object sender, EventArgs e) {
_CellColorHelper.SetCellColor(Convert.ToInt32(spinEdit1.Value), gridView1.Columns[Convert.ToInt32(spinEdit2.Value)], colorEdit1.Color);
}
- CellColorHelper.cs (VB: CellColorHelper.vb)
- Form1.cs (VB: Form1.vb)
(you will be redirected to DevExpress.com to submit your response)