In our application, we implement an undo function via thecommand "System.Windows.Input.ApplicationCommands.Undo". We are assuming that the Syncfusion GridControl uses the same command to undo actions that are grid-related.
We would like to handle the undo command on a high level. Unfortunately, the Syncfusion GridControl is "stealing"/handling the command too early so that a click on our undo button does not have any effect (not even in the grid, I disabled the command stack of the GridControl.Model with
GridControl.Model.CommandStack.Enabled = false).
Is our assumption true, that Syncfusion's GridControl handles the ApplicationCommands.Undo command? I found no CommandBinding to this command, though. So where does the handling happen?
Is there a way to prevent the GridControl from messing with the undo command altogether, instead of just disabling the command stack?
KBKanimozhi Bharathi Syncfusion Team July 5, 2016 12:42 PM UTC
Hi Marco Studer,
We have checked your issue and you can overcome this issue by removing the Undo Command registered by the CommandManager internally in the GridControl. Since GridControl also uses the “ApplicationCommands.Undo” which internally handles the undo operation if the CommandStack is not enabled. Please find the code example for your reference,
KBKanimozhi Bharathi Syncfusion Team July 5, 2016 05:09 PM UTC
Hi Marco Studer,
Please ignore the previous update.
We have checked your issue and you can overcome this issue by overriding the GridControl class and invoke the OnCanExecuteUndo method. Since the ApplicationCommands.Undo is registered by the CommandManager internally in the GridControl and it handles the undo operation in OnCanExecuteUndo method, if the CommandStack is not enabled. We have also prepared the sample for your reference. Please find the link below