Skip to content

Latest commit

 

History

History
50 lines (34 loc) · 2.91 KB

File metadata and controls

50 lines (34 loc) · 2.91 KB

WinForms Data Grid - Customize cell appearance

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);
}

WinForms Data Grid - Customize cell appearance

Files to Review

Documentation

See Also

Does this example address your development requirements/objectives?

(you will be redirected to DevExpress.com to submit your response)