Class UndoRedoEventArgs<TValue>
Provides common information for undo and redo event callbacks in the grid.
Inheritance
Inherited Members
Namespace: Syncfusion.Blazor.Grids
Assembly: Syncfusion.Blazor.Grids.dll
Syntax
public class UndoRedoEventArgs<TValue> : GridEventBaseArgs
Type Parameters
| Name | Description |
|---|---|
| TValue | The type of data bound to the grid rows. |
Remarks
This base class contains shared properties used by all undo/redo event callbacks (OnUndoEventArgs<TValue>, OnUndoCompletedEventArgs<TValue>, OnRedoEventArgs<TValue>, and OnRedoCompletedEventArgs<TValue>).
The properties provide information about the action being undone or redone, including the action type, affected row and column indices, the cell field name (for cell edits), and the old/new values involved in the action.
CellEdit actions provide cell coordinates and old/new values. RowAdd and RowDelete actions provide the row index
and row data through both value properties. Paste and AutoFill actions cover multiple cells, so
RowIndex, ColumnIndex, FieldName, OldValue, and
NewValue are all default values (-1 or null); the per-cell payload for these
actions is captured internally in the corresponding UndoRedoAction<T> entry's
PreviousValues list, but there is no public API on SfGrid that returns
these actions to a caller today.
Constructors
UndoRedoEventArgs()
Declaration
public UndoRedoEventArgs()
Properties
ActionType
Gets the type of action that is being undone or redone.
Declaration
public UndoRedoActionType ActionType { get; }
Property Value
| Type | Description |
|---|---|
| UndoRedoActionType | One of the UndoRedoActionType values: |
ColumnIndex
Gets the index of the column that contains the affected cell for CellEdit actions.
Declaration
public int ColumnIndex { get; }
Property Value
| Type | Description |
|---|---|
| int | The zero-based index of the edited cell within the visible leaf columns for a
CellEdit action. The value is |
FieldName
Gets the field name of the column that identifies the affected cell for CellEdit actions.
Declaration
public string? FieldName { get; }
Property Value
| Type | Description |
|---|---|
| string | The field name of the edited column for a CellEdit action.
Returns |
NewValue
Gets the value that was applied by the original action.
Declaration
public object? NewValue { get; }
Property Value
| Type | Description |
|---|---|
| object | For CellEdit, the value after the edit, exposed as object because
a cell edit may target any column type. For RowAdd and
RowDelete, contains the affected row data typed as |
Remarks
When ActionType is RowAdd or RowDelete,
the returned value is the row itself typed as TValue; consumers no longer need to cast
from object. Because row actions have no distinct "previous" and "applied" cell values, this
property and OldValue reference the same row instance and always compare as equal for those
action types. Use the strongly-typed RowData property as the recommended accessor for the
affected row, and branch on ActionType rather than relying on a difference between
OldValue and NewValue.
OldValue
Gets the value that was in effect before the original action.
Declaration
public object? OldValue { get; }
Property Value
| Type | Description |
|---|---|
| object | For CellEdit, the value before the edit, exposed as object because
a cell edit may target any column type. For RowAdd and
RowDelete, contains the affected row data typed as |
Remarks
Row add and row delete actions have no distinct "previous" and "applied" cell values, so this property and
NewValue reference the same row instance and always compare as equal for those action types.
Consumers that need the affected row should read the strongly-typed RowData property, and any
logic that distinguishes action types must branch on ActionType rather than rely on a difference
between OldValue and NewValue.
RowData
Declaration
public TValue? RowData { get; }
Property Value
| Type | Description |
|---|---|
| TValue | A |
Remarks
This property is a typed accessor for the row data carried by RowAdd and RowDelete actions. For CellEdit, Paste, and AutoFill actions the per-cell information is exposed via OldValue, NewValue, FieldName, and ColumnIndex.
RowIndex
Gets the index of the row affected by the undo or redo action.
Declaration
public int RowIndex { get; }
Property Value
| Type | Description |
|---|---|
| int | The zero-based affected row index. For Paste and AutoFill, the value is |