Skip to content

DevExpress-Examples/winforms-grid-customize-cell-color

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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)