if(e.ColIndex > 0 && e.RowIndex > 0) { int colIndex = grid.Binder.NameToCOlIndex("TestValue"); object testValue = grid[e.RowIndex, colIndex].Cellvalue; if(testValue == xyz) e.Style.BackColor = Color.Red; }
>if(e.ColIndex > 0 && e.RowIndex > 0) >{ > int colIndex = grid.Binder.NameToCOlIndex("TestValue"); > object testValue = grid[e.RowIndex, colIndex].Cellvalue; > if(testValue == xyz) > e.Style.BackColor = Color.Red; >} >
private void TableControl_PrepareViewStyleInfo(object sender, GridTableControlPrepareViewStyleInfoEventArgs e)
{
GridTableCellStyleInfo style = (GridTableCellStyleInfo) e.Inner.Style;
if (style.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| style.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
int colIndex=this.gridGroupingControl1.TableModel.NameToColIndex("Col1");
GridTableCellStyleInfo style1 = this.gridGroupingControl1.Table.GetTableCellStyle(e.Inner.RowIndex,colIndex);
if(style1.Text =="row1 col1")
e.Inner.Style.BackColor=Color.LightPink;
}
}
Here is a sample.
GC_BackColor.zip
Let us know if this serves your purpose.
Best Regards,
Jeba