I have to format (backcolor, forecolor, font style) a radgrid's cells depending on the value of the cell.
For example If the value is negative set the fore color of that cell as red.
Can any one please tell me how this can be achieved?
protected void grdName_ItemDataBound(object sender, GridItemEventArgs e)
{
if (e.Item is GridDataItem)
{
GridDataItem item = (GridDataItem)e.Item;
if (Convert.ToInt32(((DataRowView)item.DataItem)["Column"]) < value)
{
TableCell cell = item["Column"];
cell.BackColor = Color.PeachPuff;
}
}
}