Insert Content into Radeditor at current Cursor point when Radgrid on clirent row selected event

4 posts, 0 answers
  1. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 13 Jun 2013 Link to this post

    Hi,
    I am having a Radeditor control. When i click on the radgrid i need insert the text to radeditor on  the current cursor point. i can able to detect the row click event. but the content is not inserted into radeditor and i can't set focus to radeditor. 








    Thanks
  2. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 17 Jun 2013 Link to this post

    Hi,
           It will be helpful if i get a quick response for this issue from forums . please let me know whether this is possible to paste a content from radgrid value to editor control, on the cursor point.





    Thanks
  3. Ivaylo
    Admin
    Ivaylo avatar
    37 posts

    Posted 18 Jun 2013 Link to this post

    Hello Dhamodharan,

    To achieve the desired behavior you can attach to the OnRowClick client event of RadGrid and get the content of the clicked cell (eventArgs.get_itemIndexHierarchical().toString()). Then, you can use the pasteHtml() method of the Editor which will paste the cell's content at the last cursor position in the control (0 if not otherwise initialized).

    I have prepared and attached a sample project for illustrative purposes, which you can freely extend to fit you requirements.

    Should you want to change the cursor's position dynamically you can refer to the getRange() and selectRange() client functions of the Editor.

    The pasteHtml() method for pasting in the cursor posoition has already been discussed in your other thread with the same question: Paste the Content at the Cursor point.
     
    Regards,
    Ivaylo
    Telerik
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to the blog feed now.
  4. Dhamodharan
    Dhamodharan avatar
    300 posts
    Member since:
    Sep 2010

    Posted 24 Jun 2013 Link to this post

    Hi lvaylo,
    Thanks for your reply. I tried your solution, but still I miss something i couldn't get the focus of rad editor. I think I miss in following part as 

    $telerik.$("*", combobox.get_dropDownElement()).attr("unselectable""on");


    what should be used for radgrid
Back to Top