Click here to Skip to main content
15,921,622 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am getting this error while using appearance setting to color a cell

'DevExpress.XtraGrid.StyleFormatCondition' does not contain a definition for 'Appearance'

this the code that i'm trying to use, please help

private void gridView3_RowCellStyle(object sender, DevExpress.XtraGrid.Views.Grid.RowCellStyleEventArgs e)
    GridView View = sender as GridView;
    if (e.Column.FieldName == "First Name" &&
        string.IsNullOrEmpty(View.GetRowCellDisplayText(e.RowHandle, e.Column)))
        e.Appearance.BackColor = Color.DeepSkyBlue;
Updated 6-Feb-13 2:38am


Use like the following:

e.Row.Cells[0].BackColor = Color.Red;

in place of

e.Appearance.BackColor = Color.DeepSkyBlue;

Share this answer
Please see this thread if it helps.

Change Cell color


you need to handle GridView.CustomDrawCell event.

Private Sub grdView_CustomDrawCell(sender As Object, e As RowCellCustomDrawEventArgs)

Share this answer

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900