Adding Classes to the Css drop down

5 posts, 0 answers
  1. Rick
    Rick avatar
    4 posts
    Member since:
    Sep 2011

    Posted 29 Sep 2011 Link to this post

    Hi,

    I am trying to customize the CSS classes availalble on both the Image Properties Dialog and the Hyperlink Manager.
    I've tried following the instructions here:
    http://www.telerik.com/help/aspnet-ajax/editor-css-styles.html


    By adding:
    <CssClasses>
           
    <telerik:EditorCssClass Name="Clear Class" Value="" />
           
    <telerik:EditorCssClass Name="link" Value="a.link" />
           
    <telerik:EditorCssClass Name="img" Value=".img" />
           
    <telerik:EditorCssClass Name="redtext" Value=".redtext" />
       
    </CssClasses>

    But the only CSS class is the built in "Clear Class". I've tried adding via the tools file, external css file, and using the .Add Method. 
    No luck with any. 
    Any help would be appreciated.
  2. Rumen
    Admin
    Rumen avatar
    14467 posts

    Posted 03 Oct 2011 Link to this post

    Hello Rick,

    The purpose of the CssClasses collection is to restrict the CSS classes to be loaded in the Apply Class dropdown. In order to load CSS classes in the CSS dropdowns you should define them in the page with the editor or import them via the CssFiles property.

    Greetings,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  3. Craig Tarr
    Craig Tarr avatar
    13 posts
    Member since:
    Oct 2009

    Posted 21 Oct 2011 Link to this post

    Rumen, is there a way in this version of the control to default CSS Class selector to a specific item? On Load it's set to Apply Class, I want to always default it to a custom class. 

    I was able to do this previously Apply CSS OnInit

    I'm searching the demos and documentation but haven't found a clear example yet.


    Thanks,
    Craig
  4. Rumen
    Admin
    Rumen avatar
    14467 posts

    Posted 25 Oct 2011 Link to this post

    Hello Craig,

    You can write a custom content filter that will apply the desired className to the desired HTML elements in the content area. The filter will be executed when switching to HTML mode or when submitting the content.

    Of course you can modify the built-in dialogs and implement the requested functionality. The following demo shows how to register the external dialogs and customize the LinkManager.ascx dialog: Customize Built-in Dialogs.

    You can also attach to the OnClientPasteHtml event and modify the inserted via the LinkManager HTML content before it is pasted in the content area.


    All the best,
    Rumen
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now
  5. Craig Tarr
    Craig Tarr avatar
    13 posts
    Member since:
    Oct 2009

    Posted 04 Nov 2011 Link to this post

    Thanks Rumen!
    We followed your second suggestion.


    To set the value of the CSS Class to always be selected I added the following ELSE clause to the LInkManger.ascx file. In the _loadCssClasses

    if (currentLink.className != null && currentLink.className != "") {
                    this._linkCssClass.updateValue(currentLink.className);
                    this._emailCssClass.updateValue(currentLink.className);
                }
                else {
                    this._linkCssClass.updateValue("acceptPromo");
                }
Back to Top