This is a migrated thread and some comments may be shown as answers.

Change the column forecolor

1 Answer 44 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Savyo
Top achievements
Rank 1
Savyo asked on 04 Oct 2012, 12:25 PM
Hi there,
     How can I change the forecolor of a grid bound column from code behind. Please do share I you have done this before or have an idea which can help me out.
thanks
Savyo

1 Answer, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 04 Oct 2012, 12:31 PM
Hi,

Please try the following code snippet to give fore color for bound column.

C#:
protected void RadGrid1_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridDataItem)
    {
        GridDataItem item = (GridDataItem)e.Item;
        item["UniqueName"].Style.Add("Color", "Red");
    }
}

Thanks,
Shinu.
Tags
Grid
Asked by
Savyo
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Share this question
or