SpreadsheetOptionsExtensions.AddCellValueChanged(SpreadsheetOptions, CellValueChangedEventHandler) Method

Connects the event with an appropriate event handler function.

Namespace: DevExpress.AspNetCore

Assembly: DevExpress.AspNetCore.Spreadsheet.v21.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 cell value changed event.

Returns

Type Description
SpreadsheetOptions

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

Remarks

services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
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