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

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

3 Answers 70 Views
Editor
This is a migrated thread and some comments may be shown as answers.
Dhamodharan
Top achievements
Rank 1
Dhamodharan asked on 13 Jun 2013, 11:33 AM
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

3 Answers, 1 is accepted

Sort by
0
Dhamodharan
Top achievements
Rank 1
answered on 17 Jun 2013, 06:21 PM
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
0
Ivaylo
Telerik team
answered on 18 Jun 2013, 07:55 AM
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.
0
Dhamodharan
Top achievements
Rank 1
answered on 25 Jun 2013, 03:38 AM
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
Tags
Editor
Asked by
Dhamodharan
Top achievements
Rank 1
Answers by
Dhamodharan
Top achievements
Rank 1
Ivaylo
Telerik team
Share this question
or