Maintain text format settings

2 posts, 1 answers
  1. Filipe Peixinho
    Filipe Peixinho avatar
    41 posts
    Member since:
    May 2006

    Posted 12 Sep 2011 Link to this post


    I have developed a chat app using RadEditor to type in the messages.
    I have also used the text formating capabilities from rad editor to enhance the chat, but now i'm having some technical dificulties. I want the radEditor to preserve the formating settings when i change the cursor position or when i clean/insert HTML content to the RadEditor.

    Is there a way to always keep the text formatting setting unless the user changes them?
    I'm just using the Italic,Bold,Underline and text-color.

    Any kind of help would be useful!
  2. Answer
    Rumen avatar
    14389 posts

    Posted 13 Sep 2011 Link to this post

    Hello Filipe,

    RadEditor is more similar to MS Word and does not offer the requested functionality out-of-the box. If you would like you can use the OnClientCommandExecuted event to obtain the selected values from the different formatting tools and store them in some global variables. After that in the OnClientSelectionChange event to apply the value of these variable when start typing in the content area.

    The implementation of the requested custom functionality will be not easy because the different browsers have their own implementation of the text range object. RadEditorSelection utilizes W3C Range and Microsoft TextRange objects to provide cross-browser support, however, for more advanced manipulations you will need to use the standard objects. More detailed information regarding W3C Range and Microsoft TextRange is available in the following articles:

    Kind regards,
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top