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;
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Back
Top