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

Hierarchical grid - ForeColor on header not setting

1 Answer 53 Views
Grid
This is a migrated thread and some comments may be shown as answers.
wonderbison
Top achievements
Rank 1
wonderbison asked on 21 Jun 2011, 11:39 AM
Hi

Tried the examples I have found in Telerik site to try and set the forecolor of a hierarchical grids header but nothing works. The back color is setting but not the forcolor. I have tried setting the color in my CSS, I have tried setting the color at the GridGroupHeaderItem level and setting the Forecolor at the GridGroupHeaderItem.DataCell level. Here is the latest code. Can you tell me why this isnt working? I am also wanting to set Font so I assume I will hit a similar issue. Thank you

.nomRed1
{
background-color: #ef1209; 
}
.nomRed2
{
background-color: #c1131e; 
}


protected void clientContribution_ItemDataBound(object sender, GridItemEventArgs e)
{
    if (e.Item is GridGroupHeaderItem)
    {
        GridGroupHeaderItem item = (GridGroupHeaderItem)e.Item;
        DataRowView groupDataRow = (DataRowView)e.Item.DataItem;
        item.CssClass = "nomRed1";
        item.DataCell.ForeColor = Color.Magenta;
    }
}

1 Answer, 1 is accepted

Sort by
0
wonderbison
Top achievements
Rank 1
answered on 21 Jun 2011, 02:13 PM
Well, even although not specifically set, it would appear that within my .css there was an override that was stopping the specific CSS style I was setting from being applied

Remove all the CSS and it worked
Tags
Grid
Asked by
wonderbison
Top achievements
Rank 1
Answers by
wonderbison
Top achievements
Rank 1
Share this question
or