Hi Julien,
Thanks for using Syncfusion Products.
GridConditionalFormatDescriptor only allow you to row formatting. If you want to format any one cell, then you need to use QueryCellStyleInfo or PrepareViewStyleInfo event to achieve that. Below is the example that shows to change backcolor of a negative value cell and bracket for nagative value cell. Please refer to the below code in which QueryCellStyleInfo event is used to achieve your need.
this.gridGroupingControl1.QueryCellStyleInfo += new GridTableCellStyleInfoEventHandler(gridGroupingControl1_QueryCellStyleInfo);
void gridGroupingControl1_QueryCellStyleInfo(object sender, GridTableCellStyleInfoEventArgs e)
{
if (e.TableCellIdentity.TableCellType == GridTableCellType.RecordFieldCell
|| e.TableCellIdentity.TableCellType == GridTableCellType.AlternateRecordFieldCell)
{
if (e.TableCellIdentity.Column.MappingName == "B")
{
int cellvalue = Convert.ToInt32(e.Style.CellValue);
if (cellvalue < 0)
{
e.Style.BackColor = Color.Red;
e.Style.Format = "{#,##}"; // You can set your own format
}
}
}
}
Please refer to the sample given below which illustrates the above:
http://websamples.syncfusion.com/samples/Grid.Windows/I41286/main.htmPlease let me know if you have any question.
Regards,
Subhasheela R