RadEditor-restricting the characters up to 2000 character

2 posts, 0 answers
  1. Prakash
    Prakash avatar
    4 posts
    Member since:
    Feb 2015

    Posted 11 Apr 2016 Link to this post

    We are using Telerik Web UI component version 2015.1.310.40

    We have below issue while posting the message in RadEditor, we are validating and restricting the characters up to 2000 character.

    Issue 1: We are losing the format while pasting the text from WordPad where it is working from MS-Word

    Issue 2: There were some issues while validating the count (number of character) when keying and pasting, is there any defined method to use?

    <telerik:RadEditor EditModes="Design" ID="txtMessage" OnClientLoad="OnClientLoad"
                                                                CssClass="radEMailDiv" runat="server" BackColor="White" EnableResize="false"
                                                               StripFormattingOnPaste="MSWord" OnClientCommandExecuted="getCount">

    Please suggest the solution to be used.
  2. Ianko
    Ianko avatar
    1945 posts

    Posted 14 Apr 2016 Link to this post

    Hello Prakash,

    First you should read more about how pasting works in RadEditor—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/managing-content/pasting-content/overview. As you would see, it is the browser's responsibility to transform clipboard data from desktop apps to web apps. That said, you will see that using even a plain editable DOM element (like this one here—https://jsbin.com/godusoqela/edit?html,output) the same results will happen when pasting from WordPad.

    As for validation, there is no built-in approach to validate text while  pasting and typing. This is a functionality that should be further handled by using the client-side event handlers—http://docs.telerik.com/devtools/aspnet-ajax/controls/editor/client-side-programming/events/overview

    Do you need help with upgrading your ASP.NET AJAX, WPF or WinForms projects? Check the Telerik API Analyzer and share your thoughts.
Back to Top