WPF RadRichTexBox - Disable "Undo" Dropdown

7 posts, 0 answers
  1. Ramalingam
    Ramalingam avatar
    21 posts
    Member since:
    Apr 2014

    Posted 19 Nov 2014 Link to this post

    Hi Team,
    Could you please help us on below issue :

    1) I have typed the word "testing"

    2) Deleted "ing" and the current text is "test"

    3) When I see the "Undo", It shows all the operations, like shown in the attachment "Undo - Dropdown.png"

    4) Please suggest us the way to disable this "Undo" Dropdown, We like to shown only the "Undo" button (without dropdown)

    Thanks,
    Obuliraj Ramalingam
  2. Todor
    Admin
    Todor avatar
    168 posts

    Posted 20 Nov 2014 Link to this post

    Hi Ramalingam,

    You can set the UndoCommand to a RadRibbonButton instead of the default RadRibbonSplitButton in the RadRichTextBoxRibbonUI as follows:
    <telerik:RadRibbonButton telerik:RadRichTextBoxRibbonUI.RichTextCommand="{Binding UndoCommand}" Size="Small" SmallImage="/Telerik.Windows.Controls.RichTextBoxUI;component/Images/MSOffice/16/undo.png" Text="Undo"/>

    In this way you will achieve the desired look and functionality.

    I hope this helps.

    Regards,
    Todor
    Telerik
     

    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. UI for WPF is Visual Studio 2017 Ready
  4. Ramalingam
    Ramalingam avatar
    21 posts
    Member since:
    Apr 2014

    Posted 04 Dec 2014 in reply to Todor Link to this post

    Hi Todor,
        Thanks for the suggestion.

    Undo - Dropdown is not shown now, However the "down arrow" image (next to Undo image) is still shown.
    Please refer to the attachment "Undo dropdown arrow.png"

    Could you please suggest a way to hide this "down arrow" image also.

    Thanks,
    Obuliraj Ramalingam


  5. Todor
    Admin
    Todor avatar
    168 posts

    Posted 08 Dec 2014 Link to this post

    Hello Ramalingam,

    The button which is shown on the image doesn't look like a RadRibbonButton. For your convenience, I've created a sample demo project which illustrates the desired look and behavior for the Undo button.
    Please find it attached.

    I hope this helps.

    Regards,
    Todor
    Telerik
     

    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.

     
  6. Ramalingam
    Ramalingam avatar
    21 posts
    Member since:
    Apr 2014

    Posted 22 Dec 2014 in reply to Todor Link to this post

    Hi,
    Thanks for the sample. I am able to hide the "dropdown" image now.

    Could you please suggest a way to set Undo Levels :

    For example, User is allowed to Undo of 25 previous operations,
    Undo button will be disabled or we need to ignore Undo operation after 25 operations.

    Thanks,
    Obuliraj Ramalingam
  7. Tanya
    Admin
    Tanya avatar
    405 posts

    Posted 22 Dec 2014 Link to this post

    Hi Obuliraj,

    This functionality comes out-of-the-box with the History feature. You should set the Depth property of the RadDocuments' History:
    this.radRichTextBox.Document.History.Depth = 25;
    By setting this property, you specify how many actions shall be recorded in the RadDocument's history. After the 25th operation the Undo button will be disabled automatically, because there won't be any other recorded actions.

    Please, let us know if you have other questions.

    Regards,
    Tanya
    Telerik
     

    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.

     
  8. Ramalingam
    Ramalingam avatar
    21 posts
    Member since:
    Apr 2014

    Posted 24 Dec 2014 in reply to Tanya Link to this post

    Hi Tanya,
    Thanks for the suggestion. It's working now.

    Thanks,
    Obuliraj Ramalingam
Back to Top
UI for WPF is Visual Studio 2017 Ready