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

Insert text from RadListView into rad editor at cursor position

1 Answer 15 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Ravi
Top achievements
Rank 1
Ravi asked on 09 Dec 2015, 06:17 AM

This is my RadListBox

     <tele:RadListBox ID="listboxview" runat="server"  Height="500px"  Width="100%" Font-Size="11px"  DataTextField="master"
                                             DataValueField="master" OnClientSelectedIndexChanged="putTag"    OnItemDataBound="listboxview_ItemDataBound"  ></tele:RadListBox>

 This is my RadEditor

     <tele:RadEditor ID="RadEditor1" runat="server" ToolbarMode="RibbonBar" AutoResizeHeight="true" Skin="Office2007"  EnableResize="false"  Height="760px"     _ToolsFile="tools.xml"    Width="100%" >  </tele:RadEditor>

 

This is my Javascript method for pasting the Text to the Cursor Postion.

 function putTag(sender, eventArgs) {
                     debugger;
                    var itemsValue = sender.get_selectedItem().get_value();  // i got the value there from selecting the Item in the Listview
                    var editor = $find("<%= RadEditor1.ClientID %>");
                    var rng = editor.getSelection().getRange();
                    editor.getSelection().selectRange(rng);
                    editor.pasteHtml("[/" + itemsValue + "/]");
           
            }

when i click on the Listview then i want the text to the RadHtmlEditor, but using the Following codes i cant do this.

Plz correct my code.

 

 

1 Answer, 1 is accepted

Sort by
0
Ianko
Telerik team
answered on 09 Dec 2015, 07:25 AM
Hello Ravi,

The same is discussed here—http://www.telerik.com/community/forums/how-to-maintain-the-insertion-point-when-i-am-loading-a-picture-from-a-script-fired-from-a-custom-control-on-the-toolbar.

Did you try the suggestion posted there? Is there any difference with the situation here? 

Regards,
Ianko
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Editor
Asked by
Ravi
Top achievements
Rank 1
Answers by
Ianko
Telerik team
Share this question
or