SpreadsheetOptionsExtensions.AddInitializeDocument(SpreadsheetOptions, InitializeDocumentEventHandler) Method

Connects the event with an appropriate event handler function.

Namespace: DevExpress.AspNetCore

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

Declaration

public static SpreadsheetOptions AddInitializeDocument(
    this SpreadsheetOptions spreadsheetOptions,
    InitializeDocumentEventHandler handler
)

Parameters

Name Type Description
spreadsheetOptions SpreadsheetOptions

Spreadsheet options.

handler InitializeDocumentEventHandler

A function that handles the document initialize 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
                .AddInitializeDocument(
                    (object sender, SpreadsheetInitializeDocumentEventArgs e) => {
                        //make the necessary adjustments in the document model while the document is being opened for the first time.
                    }
                );
        }
    );
});
See Also