Set Datagrid Column Font Color

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Dear All,

I would like to like that how I can set the font color of a specific
column of a datagird.

For example, my datagrid contains 4 columns and may rows, but I only want
all column 2 data font color will be in Red and other data font color is
still in blank.

Thanks
 
You can create your custom DataGridColumnStyle and override the paint method
of styler and map it to the column you like

Dincer Uyav
 
Hi,
Try this out in the itemdatabound event of the grid
if(e.Item.ItemType == ListItemType.Item)
{
e.Item.Cells[1].ForeColor=Color.Red;
}
 
Back
Top