How to Reuse CSS Styles for Telerik RadControls for ASP.NET Ajax

Telerik RadControls has built-in skinning support and uses CSS to style all of its controls. However, when connecting these controls to an existing website, the best way to combine the styles of an existing site with your own RadControls styles?

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

  • Add RadControl CSS to my website
  • Make RadControls look more like my site
  • Add my CSS settings to RadControl layout lists

What would be the best option?

Option 2 will require me to support two sets of styles in the future. Therefore, option 1 is preferred. This will allow you to reuse the RadControls style system throughout the site, for example. There are buttons and simple controls that look the same.

Update 2 (rescheduled from my answer): I ended up making a combination. Using FormDecorator allows you to reuse RadControls styles on my own buttons and inputs. In addition, copying the skins provided by Telerik to my ASP.Net theme allowed me to customize the skins.

+5
source share
3 answers

, RadControls - CMS RadEditor CMS , .

, :

+2

; FormDecorator css . , , Telerik :

.cs - , :

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;
   }
}

}

aspx ( RadCodeBlock) :

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

, Telerik Telerik , - .

+1

"Style Builder" Telerik AJAX MVC, / :

http://stylebuilder.telerik.com/

CSS , .

0
source

All Articles