By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,706 Members | 2,030 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,706 IT Pros & Developers. It's quick & easy.

Set Datagrid Column Font Color

P: n/a
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
Jul 22 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a
You can create your custom DataGridColumnStyle and override the paint method
of styler and map it to the column you like

Dincer Uyav

"kobeting" wrote:
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

Jul 22 '05 #2

P: n/a
Hi,
Try this out in the itemdatabound event of the grid
if(e.Item.ItemType == ListItemType.Item)
{
e.Item.Cells[1].ForeColor=Color.Red;
}

"kobeting" wrote:
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

Jul 22 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.