Add zoom dropdown options

7 posts, 0 answers
  1. Ivan
    Ivan avatar
    16 posts
    Member since:
    Oct 2011

    Posted 15 Feb 2012 Link to this post

    Hello,

    Is it possible to add custom options to the zoom dropdown tool?
  2. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 15 Feb 2012 Link to this post

    Hello,

    Yes, it is possible to add your own values using the following declaration as a base:

    <telerik:RadEditor ID="RadEditor1" runat="server">
        <Content>
            <div id="wrapperPlayer"></div>
        </Content>
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorDropDown Name="Zoom">
                    <telerik:EditorDropDownItem Name="20%" Value="20%" />
                    <telerik:EditorDropDownItem Name="50%" Value="50%" />
                    <telerik:EditorDropDownItem Name="100%" Value="100%" />
                    <telerik:EditorDropDownItem Name="500%" Value="500%" />
                </telerik:EditorDropDown>
            </telerik:EditorToolGroup>
        </Tools>
    </telerik:RadEditor>



    Kind regards,
    Rumen
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Ivan
    Ivan avatar
    16 posts
    Member since:
    Oct 2011

    Posted 15 Feb 2012 Link to this post

    Hello,

    I have tried it, but nothing changed. Zoom dropdown still contains the same set of options.
  5. Rumen
    Admin
    Rumen avatar
    12846 posts

    Posted 15 Feb 2012 Link to this post

    Hi,

    The provided solution is for RadEditor for ASP.NET AJAX and you can see how it works in the following video:
    http://screencast.com/t/eghGzA9DP8

    Greetings,
    Rumen
    the Telerik team
    Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
  6. vkucherov
    vkucherov avatar
    6 posts
    Member since:
    Oct 2014

    Posted 13 Oct 2014 Link to this post

    Hi,
    Is it possible to add custom options to the zoom dropdown tool from by code using API?
    I found the zoom tool object, but it has not collection of options:

    EditorToolGroup gc = this.Editor.Tools[2];
    EditorTool t = gc.FindTool("Zoom");
  7. Ianko
    Admin
    Ianko avatar
    1535 posts

    Posted 14 Oct 2014 Link to this post

    Hello Виктор,

    The FindTool method will always return an instance of EditorTool. What is needed is to manipulate the Items collection of an EditorDropDown instance. 

    You can try achieve the desired configuration with the following example code behind logic:
    EditorToolGroup toolgroup = RadEditor1.Tools[6];
    EditorTool zoomTool = toolgroup.FindTool("Zoom");
     
    // Remove the tool to prevent tool duplication
    toolgroup.Tools.Remove(zoomTool);
     
    // Create the new Zoom dropdown
    EditorDropDown newZoomTool = new EditorDropDown(zoomTool);
    // add items
    newZoomTool.Items.Add(new EditorDropDownItem("20%", "20%"));
    newZoomTool.Items.Add(new EditorDropDownItem("50%", "50%"));
    newZoomTool.Items.Add(new EditorDropDownItem("100%", "100%"));
    newZoomTool.Items.Add(new EditorDropDownItem("500%", "500%"));
    // add the new tool to the same toolgroup
    toolgroup.Tools.Add(newZoomTool);

    Note that you should ensure that the index of the toolgroup is the proper one.

    If you need further assistance, please provide more details about the tool configuration as it seems to me that the tools are not with the default configuration.

    Regards,
    Ianko
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  8. vkucherov
    vkucherov avatar
    6 posts
    Member since:
    Oct 2014

    Posted 14 Oct 2014 Link to this post

    Hello Ianko,

    it's exactly what I need!

    I am very grateful to you!

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017