Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Editor > Insert text into rad editor at cursor position.

Answered Insert text into rad editor at cursor position.

Feed from this thread
  • Danny avatar

    Posted on Jun 2, 2012 (permalink)

    I have setup a page with rad editor. I have a related a customer combo box on the menu on the rad editor. I have not put any code or anything being the custom dropdow box. Basically, what I want to do is, any time an item is selected from the combo, the contents of the combo are inserted into the rad editor. The important part is, the contents are inserted into the place of the cursor.

    Reply

  • Answer Shinu MVP avatar

    Posted on Jun 5, 2012 (permalink)

    Hi Danny,

    Try the following code snippet to achieve your scenario.

    ASPX:
    <telerik:RadEditor ID="RadEditor1" runat="server" OnClientCommandExecuting="OnClientCommandExecuting" >
                <Tools>
                    <telerik:EditorToolGroup >
                        <telerik:EditorSplitButton Name="addData" Text="addData">
                            <telerik:EditorDropDownItem Name="one" Value="one" />
                               .................................................
                        </telerik:EditorSplitButton>
                    </telerik:EditorToolGroup>
                </Tools>
     </telerik:RadEditor>

    JS:
    <script type="text/javascript" >
            function OnClientCommandExecuting(sender, args)
            {
                var val = args.get_value();
                var name = args.get_name();
                if (name == "addData")
                {
                    sender.pasteHtml(val);
                    args.set_cancel(true);
                }
            }
     </script>

    Thanks,
    Shinu.

    Reply

  • Danny avatar

    Posted on Jul 3, 2012 (permalink)

    Thank you very much. This works great!

    Reply

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET AJAX > Editor > Insert text into rad editor at cursor position.
Related resources for "Insert text into rad editor at cursor position."

ASP.NET Editor Features  |  Documentation  |  Demos  |  Step-by-step Tutorial  ]