How to preserve the original RadGrid selected/hover row background when using ItemStyle-BackColor

Thread is closed for posting
1 posts, 1 answers
  1. Answer
    Telerik Admin
    Telerik Admin avatar
    1679 posts
    Member since:
    Oct 2004

    Posted 08 Apr 2010 Link to this post


    RadControls for ASP .NET AJAX version

    2009.1.311 and later.
    .NET version 2.0 and later
    Visual Studio version 2005 and later
    Programming language CSS only
    Browser support

    all browsers supported by RadControls for ASP .NET AJAX

    In some cases you may want to customize the RadGrid row appearance by setting ItemStyle-BackColor or AlternatingItemStyle-BackColor. This will cause RadGrid to render an inline style in the HTML output, which takes precedence over skin styles. As a result, the declared item style will override row hover and selected row styles from the skin. The following example shows how to find out the original RadGrid hover/selected row background and enforce it back.

    There are two ways to find out the original hover/selected background color - one is to use a browser web developer tool such as Firebug. The other option is to take a look into the non-embedded version of the respective skin. The non-embedded versions of all skins are available in the /Skins/ subfolder of the RadControls installation location (or ZIP).

    When the original background colors have been obtained, they must be included in a CSS rule with the !important clause, which will allow the CSS styles to override the inline background color styles.
Back to Top