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

RadGrid Header Styling Issue

3 Answers 237 Views
Grid
This is a migrated thread and some comments may be shown as answers.
AS
Top achievements
Rank 1
AS asked on 25 Nov 2015, 03:12 PM

Using a simple RadGrid that has many columns, I am unable to set the header background color using HeaderStyle-BackColor="Blue" in the <telerik:RadGrid tag.

If I have header column name that span one line, the top line it the default light gray color eaeaea from WebResource.

If I have header column names that span two lines, the top line it the default light gray color eaeaea from WebResource, and the bottom line is Blue.

It is rendered in HTML as inline ... <th class="rgHeader" style="background-color: blue;" scope="col">.

I am using v2015.3.1111.45

I can reproduce this buggy behavior in a new project with a basic Radgrid using Northwind in IE and Firefox.

 

3 Answers, 1 is accepted

Sort by
0
Pavlina
Telerik team
answered on 30 Nov 2015, 03:09 PM
Hello,

You could try using the CSS code snippet below in order to change the header background color:
.RadGrid_[SkinName] .rgHeader,
.RadGrid_[SkinName] th.rgResizeCol,
.RadGrid_[SkinName] .rgHeaderWrapper,
.RadGrid_[SkinName] .rgFilterRow
{
    background-color:blue;
}

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
AS
Top achievements
Rank 1
answered on 30 Nov 2015, 03:38 PM

Hi

I add the CSS code provided (using Default for skin ... so using .RadGrid_Default) in a RadCodeBlock in the head section of HTML, and the WebResource line gets inserted at the end of the head block, and over-rides the styles, so default styles are applied. CSS specifity is the way to go, as you indicated.

But, I have to add background-image:none as well to get it to work.

I had also reached the css specifity workaround a couple of days back, but aside from this workaround, why am I unable to set the header background color using HeaderStyle-BackColor="Blue" in the <telerik:RadGrid tag? What is that attribute for?

Thanks

0
Pavlina
Telerik team
answered on 01 Dec 2015, 05:18 PM
Hello,

Note that in the most skins of RadGrid control we are loading background images (as you already pointed) and settings back color using HeaderStyle0-BackColor property will not give any effect. The mentioned property can be used only for skins that are not loading background images, like the Metro skin for example.

Regards,
Pavlina
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Grid
Asked by
AS
Top achievements
Rank 1
Answers by
Pavlina
Telerik team
AS
Top achievements
Rank 1
Share this question
or