FormatSets Question

2 posts, 1 answers
  1. Dan Ehrmann
    Dan Ehrmann avatar
    166 posts
    Member since:
    Jul 2004

    Posted 17 Apr 2012 Link to this post

    Using the new FormatSets gadget - very nice!

    One question - can I change the section titles in the drop down?

    For example, rather than "Inline Format Sets", I might like it to say "Inline Styles"
  2. Answer
    Rumen avatar
    14386 posts

    Posted 20 Apr 2012 Link to this post


    The FormatSets tool still does not offer a localization and the only possible way to rename the strings is by overwriting the JavaScript of the tool. Here is how to do that (see the highlighted lines below):

    <telerik:RadEditor ID="RadEditor1" runat="server">
                <telerik:EditorTool Name="FormatSets" />
            <telerik:EditorFormatSet Tag="H1" Title="<h1 style='color: green'>green header 1</h1>">
                    <telerik:EditorFormatSetAttribute Name="class" Value="greenClass" />
                    <telerik:EditorFormatSetAttribute Name="style" Value="color: green;" />
            <telerik:EditorFormatSet Tag="img" Title="<span style='border: 1px solid red;'>red border image</span>">
                    <telerik:EditorFormatSetAttribute Name="class" Value="redBorderImage" />
                    <telerik:EditorFormatSetAttribute Name="style" Value="border: 1px solid red; margin: 10px;" />
            <telerik:EditorFormatSet Tag="li" Title="<ul><li style='list-style-type: square;color: Red;'>square red list</li></ul>">
                    <telerik:EditorFormatSetAttribute Name="style" Value="list-style-type: square;color: red;" />
            <telerik:EditorFormatSet Tag="" Title="<span style='color: Magenta'>magenta text</span>">
                    <telerik:EditorFormatSetAttribute Name="style" Value="color: Magenta" />
    <script type="text/javascript">
        var $ = $telerik.$,
        $T = Telerik.Web.UI;
        $.registerControlProperties($T.Editor.FormatSetsDropDown, {
            clientStateFieldID: null,
            blockSetsText: "Block Styles",
            inlineSetsText: "Inline Styles",
            elementSetsText: "Element Styles",
            blockSets: [],
            inlineSets: [],
            elementSets: [],
            selectedElement: null,
            clientTypeName: "Telerik.Web.UI.Editor.FormatSetsDropDown"

    All the best,
    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.
Back to Top