You are not logged in.
This forum has been archived and no longer accepts new user registrations. Please report your questions, problems, and feedback to the issue page of ReoGrid on GitHub. Thank you for your cooperation.
Pages: 1
Hi,
Is it possible to disable the undo and redo feature in the grid?
For things like pasting I can handle the BeforePaste event and for pressing the delete key I can handle BeforeCellKeyDown and check if e.KeyCode = unvell.ReoGrid.Interaction.KeyCode.Delete, but I couldn't see how to do this for key combinations like Ctrl + Z.
Thanks.
Offline
Impossible to prevent undo/redo directly but there is other ways to do the same. For example you can prevent ReoGrid to perform any actions so that there will no actions can be undone by users.
Code to prevent specified type of action:
grid.BeforeActionPerform += Grid_BeforeActionPerform;
private void Grid_BeforeActionPerform(object sender, WorkbookActionEventArgs e)
{
var bargs = (unvell.ReoGrid.Events.BeforeActionPerformEventArgs)e;
// if action type is RemoveRangeData, cancel it
if (bargs.Action is unvell.ReoGrid.Actions.RemoveRangeDataAction)
{
bargs.IsCancelled = true;
}
}
What is your original requirement you want to prevent undo/redo? Maybe there is better way to do.
Offline
Thanks for the suggestion. I'll try it out. I'm struggling to convert this into VB code though. Specifically:
var bargs = (unvell.ReoGrid.Events.BeforeActionPerformEventArgs)e;
Thanks for your help.
Offline
Pages: 1