How to obtain theme colors?

5 posts, 1 answers
  1. Grigore Dolghin
    Grigore Dolghin avatar
    19 posts
    Member since:
    Mar 2010

    Posted 26 Oct 2011 Link to this post

    Hi, everyone. I'm posting a novice question but it seems I am missing something obvious and I can't find it. Any hint, point to documentation or to a specific tutorial, if exist, would be greatly appreciated.

    I'm using themes in my website. Telerik RadFormDecorator does not skin every control. For example, if I'm using Hay theme, I would want to have my tables having the same border color as the grid borders. I would want to have my disabled textboxes having the same backcolor as grid's FooterItem backcolor. I would want to have my <hr /> to be drawn using grid's border forecolor. And so on.

    On the other hand, if I change the theme, I would like to have those colors changed automatically, in order to keep them in sync with the new selected theme.

    Is this possible? How? I am not looking for ready-to-use code, but pointing me to the right direction would be great help.

    Thank you.
  2. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 27 Oct 2011 Link to this post

    Hello Grigore,

    One suggestion is you can use RadSkinManager. Here is the documentation.
    RadSkinManager

    Thanks,
    Princy.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Grigore Dolghin
    Grigore Dolghin avatar
    19 posts
    Member since:
    Mar 2010

    Posted 27 Oct 2011 Link to this post

    Hi and thanks for answering. RadSkinManager does not skin <hr />. How to obtain that?

    Edit: I am attaching a screenshot. I would like to have those horizontal lines drawn with the same blue color as the grid border. However, I don't want to hardcode the color because user can change the skin and in that case I'd want to have them drawn with the new color. As far as I know, I have to define the class for those lines, problem is I don't know the class name. Inspecting the document I saw Telerik controls automatically add the skin name to the class (class = "RadGrid RadGrid_Hay") and this is keeping me from achieving my goal. I can't hardcode "hay" in that class name!
  5. Answer
    Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 27 Oct 2011 Link to this post

    Grigore,

    For what it's worth, we do something similar to this; we have a number of controls that need to change when using different skins (and standard stuff too; the <a> tag colouring in the Black skin is too dark).

    What we do is have a set of local style sheets that are named for the skin they relate too, eg Local_Black.css, Local_Forest, etc. We make sure that the appropriate file is loaded when the skin changes. 

    We have had to get the colours for various bits using one of a couple of methods. Most notably, just reading the relevant .css files under the telerik control install folder.

    -- 
    Stuart
  6. Grigore Dolghin
    Grigore Dolghin avatar
    19 posts
    Member since:
    Mar 2010

    Posted 27 Oct 2011 Link to this post

    Thank you, Stuart! :)
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017