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

How to use ToolProviderID for multiple editors?

1 Answer 123 Views
Editor
This is a migrated thread and some comments may be shown as answers.
bemara57
Top achievements
Rank 1
bemara57 asked on 19 Jun 2008, 07:10 PM
I have several editors on a page, some are dynamically added and removed from the page. I noticed that the new 615 version offers a new property called ToolProviderID for multiple editors to share the same toolbar. My page is getting really heavy with all these editors and would like to take advantage of this, but don't know how. I found this explanation of the property: http://www.telerik.com/help/aspnet-ajax/telerik.web.ui-telerik.web.ui.radeditor-toolproviderid.html. What I want to know though is what kind of control should I point this property to? I can't count on all my editors to be on the page all the time, so I can't use one for the master toolbar since it might not be there after a postback. Should I add an invisible editor to my page and point the ToolProviderID to it, or can I point it to something like <div runat=server id="shared_toolbar"></div>?

1 Answer, 1 is accepted

Sort by
0
Tervel
Telerik team
answered on 23 Jun 2008, 03:13 PM
Hello,

Technically speaking, for the correct initialization of one editor from a ToolProviderID, it needs to support about 10 different methods, as well as the ability to generate the correct HTML. While in theory it is possible to develop such a provider from scratch, in practice it is much easier to use a ready solution - that is, another RadEditor.

As you propose, in your case it is best to always have a RadEditor on the page, wrapped in an invisible DIV, e..g.

<div style="display:none">
<telerik:RadEditor id="ToolProviderIDEditor" ...../>
</div>


Then, you need to set the other editors' ToolProviderID property to the ClientID of this editor. Since the actual binding between the editor and the tool provider happens on the client, there would be no problem with not being able to find the provider on the server. If the ID is set correctly and the "slave" editor is able to find its "master" provider on the clientside, all should work fine.


Greetings,
Tervel
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
Tags
Editor
Asked by
bemara57
Top achievements
Rank 1
Answers by
Tervel
Telerik team
Share this question
or