alexa
menu

Blazor

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Search Results for

    Show / Hide Table of Contents

    Class UndoRedoEventArgs<TValue>

    Provides common information for undo and redo event callbacks in the grid.

    Inheritance
    object
    GridEventBaseArgs
    UndoRedoEventArgs<TValue>
    OnRedoCompletedEventArgs<TValue>
    OnRedoEventArgs<TValue>
    OnUndoCompletedEventArgs<TValue>
    OnUndoEventArgs<TValue>
    Inherited Members
    GridEventBaseArgs.PreventRender
    object.Equals(object)
    object.Equals(object, object)
    object.GetHashCode()
    object.GetType()
    object.MemberwiseClone()
    object.ReferenceEquals(object, object)
    object.ToString()
    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: None, CellEdit, RowAdd, RowDelete, Paste, or AutoFill. The default value is None.

    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 -1 for row, Paste, and AutoFill actions because no single cell is identified. The default value is -1.

    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 null for RowAdd, RowDelete, Paste, and AutoFill actions. The default value is null.

    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 TValue and references the same row instance as OldValue. For Paste and AutoFill, the value is null. The default value is null.

    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 TValue and references the same row instance as NewValue. For Paste and AutoFill, the value is null. The default value is null.

    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

    Gets the row data associated with RowAdd or RowDelete actions, typed as TValue.

    Declaration
    public TValue? RowData { get; }
    Property Value
    Type Description
    TValue

    A TValue representing the row that was added or deleted. Returns null for CellEdit, Paste, and AutoFill actions; the per-cell payload for these action types is captured internally on the corresponding UndoRedoAction<T> entry in PreviousValues. The default value is null.

    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 -1; otherwise it identifies the edited or added/deleted row. The default value is -1.

    In this article
    Back to top Generated by DocFX
    Copyright © 2001 - 2026 Syncfusion Inc. All Rights Reserved