Class DataGridUndoRedoController
Manages undo and redo operations for cell editing in SfDataGrid.
Namespace: Syncfusion.Maui.DataGrid
Assembly: Syncfusion.Maui.DataGrid.dll
Syntax
public class DataGridUndoRedoController : BindableObject
Constructors
DataGridUndoRedoController(SfDataGrid)
Initializes a new instance of the DataGridUndoRedoController class.
Declaration
public DataGridUndoRedoController(SfDataGrid dataGrid)
Parameters
| Type | Name | Description |
|---|---|---|
| SfDataGrid | dataGrid | The parent SfDataGrid control. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown when dataGrid is null. |
Fields
RedoCountProperty
Bindable property for redo count.
Declaration
public static readonly BindableProperty RedoCountProperty
Field Value
| Type |
|---|
| BindableProperty |
UndoCountProperty
Bindable property for undo count.
Declaration
public static readonly BindableProperty UndoCountProperty
Field Value
| Type |
|---|
| BindableProperty |
Properties
RedoCount
Gets the count of redo operations available in the redo stack.
Declaration
public int RedoCount { get; }
Property Value
| Type |
|---|
| int |
UndoCount
Gets the count of undo operations available in the undo stack.
Declaration
public int UndoCount { get; }
Property Value
| Type |
|---|
| int |
Methods
ClearHistory()
Clears all undo and redo history.
Declaration
public void ClearHistory()
ClearHistoryDueToGridChange()
Clears all undo and redo history due to a structural change in the grid
Declaration
public void ClearHistoryDueToGridChange()
Redo()
Reapplies the most recently undone cell edit.
Declaration
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "The ApplyCellValue method is not trim compatible")]
public void Redo()
Undo()
Reverts the most recent cell edit by undoing its change.
Declaration
[UnconditionalSuppressMessage("Trimming", "IL2026:Members annotated with 'RequiresUnreferencedCodeAttribute' require dynamic access otherwise can break functionality when trimming application code", Justification = "The ApplyCellValue method is not trim compatible")]
public void Undo()