Fire the editors paste command from a button outside the editor

2 posts, 0 answers
  1. Dave Miller
    Dave Miller avatar
    64 posts
    Member since:
    Oct 2004

    Posted 14 Nov 2014 Link to this post

    I am using the editor as a textbox and want to use a button outside the editor to fire it's paste command.
    The function below works to insert text but what I am trying to do is paste a screenshot from the clipboard into the editor using IE 11 clipboardData.

    function Paste() {

    var editor = $find("<%=RadEditor1.ClientID%>");
    //var clipBoardData = window.clipboardData.getData("URL");

    Using the editor's paste button works for this but I am trying to use the editor to load the screenshot and as a large preview textbox before saving it.

    when I hide the toolbar if you put the cursor in the editor and do a ctrl - v it does paste the screenshot but if you right click there is no paste option.

    I am trying to have a paste button outside the editor to make it more intuitive for the users.

    Thanks in advance,
  2. Ianko
    Ianko avatar
    1507 posts

    Posted 19 Nov 2014 Link to this post

    Hi Dave,

    Thank you for contacting the Telerik support.

    I might be wrong, but it seems to me that the requirement is to replicate the native paste command of the browser via external button.

    You can achieve this by using the executeBrowserComamnd method:
    <telerik:RadEditor ID="RadEditor1" runat="server">
    <telerik:RadButton runat="server" ID="RadButton1" AutoPostBack="false"
        OnClientClicked="OnClientClicked" text="Paste"></telerik:RadButton>
    <script type="text/javascript">
        function OnClientClicked() {
            var editor = $find("<%=RadEditor1.ClientID %>");

    Under IE browsers, this will behave as if the Ctrl+V shortcut is pressed.

    If I am wrong about the required button's behavior, please provide more details, so that I could better understand the situation.

    I am looking forward to your reply.


    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

  3. DevCraft R3 2016 release webinar banner
Back to Top