Version

Limit the Undo History

The DataPresenter controls do not limit the number of actions saved internally in their undo history when you enable undo operations. This default behavior can cause your application to consume more memory as your end users use your application to make changes to a DataPresenter control. However, you can modify this behavior by setting a DataPresenter control’s UndoLimit property.

If you set the UndoLimit property to a value greater than 0, the DataPresenter controls will only track the most recent n-number of actions. As a result, your end users will only be able to undo the most recent n-number of changes to a DataPresenter control. Conversely, you can remove the limit by setting the UndoLimit property to 0.

The following example code demonstrates how to limit the undo history of the xamDataPresenter™ control.

In XAML:

<igDP:XamDataPresenter
    Name="xamDataPresenter1"
    BindToSampleData="True"
    IsUndoEnabled="True"
    UndoLimit="5"></igDP:XamDataPresenter>

In Visual Basic:

...
Me.xamDataPresenter1.UndoLimit = 5
...

In C#:

...
this.xamDataPresenter1.UndoLimit = 5;
...