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

Maintaining selection after mode switch?

1 Answer 34 Views
Editor
This is a migrated thread and some comments may be shown as answers.
tim
Top achievements
Rank 1
tim asked on 03 May 2011, 01:00 AM
Hi

A client has requested that in the editor the selection is maintained when you switch modes. I coulnd't find an example of this on the site but I noticed that I can grab the selection using OnClientSelectionChange, and I can detect the event BEFORE a mode change using OnClientModeChange. I just couldn't see how to perform a selection event AFTER the mode change in order to maintain the selection position.

I think that I'd have to find the string position of the html source of the selection in the html editing textarea, and use setSelectionRange() ( or IE hack / equivalent) to mark the selection area.

Is there a built-in method for doing this?

Tim

1 Answer, 1 is accepted

Sort by
0
Stanimir
Telerik team
answered on 05 May 2011, 12:53 PM
Hi Tim,

Unfortunately the desired functionality is not easy to achieve. You can try to save the selection range before the user changes the mode to HTML and restore it after he returns back to Design, but you need to consider that content might be changed. You can find helpful information on selection and ranges in the following site:
Introduction to Range


Regards,
Stanimir
the Telerik team

Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Tags
Editor
Asked by
tim
Top achievements
Rank 1
Answers by
Stanimir
Telerik team
Share this question
or