5

Telerik RadControls have builtin support for skinning and uses CSS to style all their controls. However, when plugging these controls into an existing website, what is the best way to merge the styles of the existing site with RadControls own styles?

Update: Given the following options (thanks to Zhaph):

  1. Add the RadControl's CSS to my site
  2. Make the RadControls look more like my site
  3. Add my sites CSS selections to the RadControl style lists

What would be the best option?

Option 2 would require that I maintain two sets of styles going forward. So preferably option 1. That would enable reuse of the RadControls style system across the site, e.g. have buttons and simple controls look the same.

Update 2 (moved from my answer): I ended up doing a combination. Using the FormDecorator enables reuse of the RadControls styles on my own buttons and inputs. Also, copying the skins provided by Telerik into my ASP.Net theme enabled customizing the skins.

2
  • Do you mean how to add the RadControl's CSS to your site, or how to make the RadControls look more like your site, or how to add your sites CSS selections to the RadControl style lists? Commented Sep 12, 2009 at 9:54
  • Whichever is the easiest. I know RC can be styled to look like my site, but then I would have to maintain two sets of styles going forward. Commented Sep 12, 2009 at 9:59

3 Answers 3

2

I have to admit, I've not used the RadControls for some time - we used the CMS RadEditor on a few CMS sites, and that could automatically pick up your style sheets, and add the classes to its list, or you could add some manually.

Looking that the documentation, some bits might help:

  1. RadEditor CSS Classes and Their Use - Although usually these are added automatically by the controls I thought?
  2. The link for 1. also tells you how to do this
  3. A couple of options
    • External CSS Files, which states "By default RadEditor for ASP.NET AJAX uses the CSS classes available in the current page", but also shows how to load other style sheets.
    • Using the ToolsFile.xml - Scroll down to the <class> element.
Sign up to request clarification or add additional context in comments.

Comments

1

I just wanted to add; the FormDecorator only applies css to certain types of controls. If you have a control that isn't styled you can access the Telerik resources like this:

.cs File - have a public property like follows:

public string HeaderDivBackgroundURL
{
   get
{
{
     string backgroundURL = string.Empty;
     string skin = ((MainMaster)Page.Master).AppSkin;
     backgroundURL = Page.ClientScript.GetWebResourceUrl(typeof(RadSplitter), "Telerik.Web.UI.Skins." + skin + ".Splitter.slideTitleContainerBgr.gif");
     return backgroundURL;
   }
}

}

In the aspx page (in a RadCodeBlock), just have an internal style sheet to read from that property:

<tel:RadCodeBlock runat="server">
    <style type="text/css">
        .telerikBackgroundMock
        {
            background: url('<%= HeaderDivBackgroundURL %>') repeat-x;
        }
    </style>
</tel:RadCodeBlock>

I found this very useful for applying Telerik skins to non-Telerik control in a way that would still be dynamic and change with any skin changes.

Comments

0

As an update to this thread, there is now an online "Style Builder" for the Telerik AJAX and MVC tools that enables visual configuration/customization of the built-in skins:

http://stylebuilder.telerik.com/

This tool eliminates the need to understand CSS class definitions for each control and lets you easily customize one of the built-in themes to better match your site.

1 Comment

Not the answer to the question

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.