Skip to main content
All docs
V26.1
  • SpreadsheetOptionsExtensions.AddCellValueChanged(SpreadsheetOptions, CellValueChangedEventHandler) Method

    Connects the event with an event handler function.

    Namespace: DevExpress.AspNetCore

    Assembly: DevExpress.AspNetCore.Spreadsheet.v26.1.dll

    Declaration

    public static SpreadsheetOptions AddCellValueChanged(
        this SpreadsheetOptions spreadsheetOptions,
        CellValueChangedEventHandler handler
    )

    Parameters

    Name Type Description
    spreadsheetOptions SpreadsheetOptions

    Spreadsheet options.

    handler CellValueChangedEventHandler

    A function that handles the CellValueChanged event.

    Returns

    Type Description
    SpreadsheetOptions

    An object that can be used to further configure the Spreadsheet options.

    Remarks

    The example below demonstrates how to handle the CellValueChanged event:

    builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
    builder.Services.AddDevExpressControls(options => {
        options.AddSpreadsheet(
            spreadsheetOptions => {
                spreadsheetOptions
                    .AddCellValueChanged(
                        (object sender, SpreadsheetCellEventArgs e) => {
                            if (!e.OldValue.IsEmpty && e.Value.IsEmpty)
                                e.Cell.Value = "deleted";
                        }
                    );
            }
        );
    });
    
    See Also