Groups | Blog | Home
all groups > dotnet general > july 2005 >

dotnet general : Set Datagrid Column Font Color


kobeting
7/13/2005 9:36:02 PM
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.

Dincer Uyav
7/14/2005 5:16:02 AM
You can create your custom DataGridColumnStyle and override the paint method
of styler and map it to the column you like

Dincer Uyav

[quoted text, click to view]
Gayathri
7/14/2005 6:17:06 AM
Hi,
Try this out in the itemdatabound event of the grid
if(e.Item.ItemType == ListItemType.Item)
{
e.Item.Cells[1].ForeColor=Color.Red;
}

[quoted text, click to view]
AddThis Social Bookmark Button