Skip to main content
A newer version of this page is available. .

SpreadsheetOptionsExtensions.AddAutoSaving(SpreadsheetOptions, DocumentAutoSavingEventHandler) Method

Connects the event with an appropriate event handler function.

Namespace: DevExpress.AspNetCore

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

NuGet Package: DevExpress.AspNetCore.Spreadsheet

Declaration

public static SpreadsheetOptions AddAutoSaving(
    this SpreadsheetOptions spreadsheetOptions,
    DocumentAutoSavingEventHandler handler
)

Parameters

Name Type Description
spreadsheetOptions SpreadsheetOptions

Spreadsheet options.

handler DocumentAutoSavingEventHandler

A function that handles the document auto saving 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
                .AddAutoSaving(
                    (IDocumentInfo documentInfo, DocumentSavingEventArgs e) => {
                        // handle AutoSave here
                        if(someCondition)
                            e.Handled = true;
                    }
                );
        }
    );
});
See Also