RadGrid Header Styling Issue

4 posts, 0 answers
  1. AS
    AS avatar
    14 posts
    Member since:
    Jan 2015

    Posted 25 Nov 2015 Link to this post

    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.

     

  2. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 30 Nov 2015 Link to this post

    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
  3. AS
    AS avatar
    14 posts
    Member since:
    Jan 2015

    Posted 30 Nov 2015 in reply to Pavlina Link to this post

    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

  4. Pavlina
    Admin
    Pavlina avatar
    6187 posts

    Posted 01 Dec 2015 Link to this post

    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
Back to Top