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;
    }
}
Posted
Updated 6-Feb-13 2:38am
v2

HI,

Use like the following:

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


in place of

e.Appearance.BackColor = Color.DeepSkyBlue;


Thanks
 
Share this answer
 
Please see this thread if it helps.

Change Cell color

Summary

you need to handle GridView.CustomDrawCell event.

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


Thanks
 
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