Checkbox or Toggle Button on Toolbar

3 posts, 0 answers
  1. Cary
    Cary avatar
    18 posts
    Member since:
    Feb 2008

    Posted 24 Nov 2008 Link to this post

    Is it possible to add a checkbox or a toggle button to the toolbar . What we are doing is we allow uses to add comments, and they can choose whether the comment is private or public. I need a way for the user to denote that. For now I'm using a basic checkbox however since I recently incorporated a Save button into the toolbar I would like to add this feature to the tool bar as well and only have the Rad Text Box on the form.

    Thank you,
    Cary.


  2. Rumen
    Admin
    Rumen avatar
    12851 posts

    Posted 27 Nov 2008 Link to this post

    Hi Cary,

    Here is an example how to create a custom toggle button:

        <style type="text/css">
        .rade_toolbar.Default .Custom1
        {
          background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif);
        }
        </style>


    <telerik:RadEditor id="RadEditor1" Runat="server">
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="Custom1" />
            </telerik:EditorToolGroup>
        </Tools>
        <ImageManager ViewPaths="~/" UploadPaths="~/" />
        <Content>
            <div style="float: left"><img alt="" src="/aspnet/prometheus/Editor/Img/UserDir/PublicRelations/4.jpg" /></div>
        </Content>
    </telerik:RadEditor>

    <script type="text/javascript">
    RadEditorCommandList["Custom1"] = function(commandName, editor, oTool)
    {     
        var tool = oTool.get_tool().get_element();
       
        if (tool.flag)
        {
            alert("Highlighted button");
            oTool.get_tool().setState(0)
            tool.flag = false;
           
        }
        else
        {
            alert("Normal button");
            oTool.get_tool().setState(1)
            tool.flag = true;
        }
        
    };
    </script> 

    For your convenience I have attached my test page.


    Sincerely,
    Rumen
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cary
    Cary avatar
    18 posts
    Member since:
    Feb 2008

    Posted 01 Dec 2008 Link to this post

    Thank you! This helps a ton!
Back to Top