Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
200
IsUndoEnabled property?
posted

Hi all,

Standard WPF editors (e.g. TextBox) have property IsUndoEnabled. If it's true, then pressing Ctrl+Z does not undo entered text. I can't see similar property in NetAdvantage editors. Does it mean it's impossible to disable default Undo behaviour on xamEditors?

Thanks,

  • 30945
    Offline posted

    Hello,

     

    I have also submitted a Product Idea for IsUndoEnabled property for the XamEditors.  I have sent your Product Idea directly to our product management team.  Our product team chooses new Product Idea s for development based on popular feedback from our customer base.  Infragistics continues to monitor application development for all of our products, so as trends appear in requested ideas, we can plan accordingly.

     

    We value your input, and our philosophy is to enhance our toolset based on customer feedback.  If your idea is chosen for development, you will be notified at that time.  Your reference number for this Product Idea is PI12030013

     

    If you would like to follow up on your Product Idea at a later point, you may contact Developer Support management via email.  Please include the reference number of your Product Idea in the subject and body of your email message.  You can reach Developer Support management through the following email address:  dsmanager@infragistics.com

     

    Thank you for your request.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

  • 30945
    Suggested Answer
    Offline posted

    Hello,

     

    Thank you for the clarification. I have been investigating, how the Undo/Redo functionality of the our editors can be removed and I have created a sample application that demonstrates how this can be achieved. For the XamTextEditor you can create a style for it and in the Style.Resoureces section, you can add a style for the TextBox that has a Setter  for the IsUndoEnabled property, which set the IsUndoEnabled to false.

     

    For the editors that derives from XamMaskedEditor (XamNumericEditor, XamCurrencyEditor and XamDateTimeEditor), there are Undo and Redo commands that are executed when the Ctrl + C, Ctrl + V are pressed. In order to disable the Undo/Redo, you can create a style for the editor and add an EventSetter for the ExecutingCommand event and in the event handler, if the e.Command.Name is “Undo” or “Redo”, you can set the e.Cancel to True and that will prevent the command from executing.

     

    The XamComboEditor uses a TextBox, when the IsEditable property is set to True. Since the TextBox that is used, has its Style property set, if the same approach as for the XamTextEditor is used, the style for the TextBox will not be applied. In order to set the IsUndoEnabled to false, for the TextBox in the XamComboEditor, you can create a style for the XamComboEditor and add a EventSetter for the EditModeStarted event. In the event handle using the Utilities class you can get the TextBox and set its IsUndoEnabled to false.

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support

    DissableEditorsUndoRedo.zip
  • 30945
    Offline posted

    Hello,

     

    Thank you for your email. I can suggest referring to the following forum post which discuss the Undo/Redo in the XamEditors and XamDataGrid: http://blogs.infragistics.com/forums/p/37758/219144.aspx#219144

     

    Please let me know if you need any further assistance on the matter.

     

    Sincerely,

    Krasimir

    Developer Support Engineer

    Infragistics

    www.infragistics.com/support