This is a migrated thread and some comments may be shown as answers.

Add zoom dropdown options

6 Answers 97 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ivan
Top achievements
Rank 1
Ivan asked on 15 Feb 2012, 02:22 PM
Hello,

Is it possible to add custom options to the zoom dropdown tool?

6 Answers, 1 is accepted

Sort by
0
Rumen
Telerik team
answered on 15 Feb 2012, 03:56 PM
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 >>
0
Ivan
Top achievements
Rank 1
answered on 15 Feb 2012, 04:49 PM
Hello,

I have tried it, but nothing changed. Zoom dropdown still contains the same set of options.
0
Rumen
Telerik team
answered on 15 Feb 2012, 05:09 PM
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 >>
0
vkucherov
Top achievements
Rank 1
answered on 13 Oct 2014, 01:43 PM
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");
0
Ianko
Telerik team
answered on 14 Oct 2014, 07:14 AM
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.

 
0
vkucherov
Top achievements
Rank 1
answered on 14 Oct 2014, 09:53 AM
Hello Ianko,

it's exactly what I need!

I am very grateful to you!

Tags
Editor
Asked by
Ivan
Top achievements
Rank 1
Answers by
Rumen
Telerik team
Ivan
Top achievements
Rank 1
vkucherov
Top achievements
Rank 1
Ianko
Telerik team
Share this question
or