Maintaining selection after mode switch?

2 posts, 0 answers
  1. tim
    tim avatar
    3 posts
    Member since:
    May 2011

    Posted 02 May 2011 Link to this post

    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
  2. Stanimir
    Admin
    Stanimir avatar
    1654 posts

    Posted 05 May 2011 Link to this post

    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.

Back to Top