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

How to obtain theme colors?

4 Answers 290 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Grigore Dolghin
Top achievements
Rank 1
Grigore Dolghin asked on 26 Oct 2011, 08:16 PM
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.

4 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 2
answered on 27 Oct 2011, 06:25 AM
Hello Grigore,

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

Thanks,
Princy.
0
Grigore Dolghin
Top achievements
Rank 1
answered on 27 Oct 2011, 12:29 PM
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!
0
Accepted
Stuart Hemming
Top achievements
Rank 2
answered on 27 Oct 2011, 03:16 PM
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
0
Grigore Dolghin
Top achievements
Rank 1
answered on 27 Oct 2011, 10:31 PM
Thank you, Stuart! :)
Tags
General Discussions
Asked by
Grigore Dolghin
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 2
Grigore Dolghin
Top achievements
Rank 1
Stuart Hemming
Top achievements
Rank 2
Share this question
or