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

SpreadsheetOptionsExtensions.RegisterGlobalCustomFunction(SpreadsheetOptions, ICustomFunction) Method

Registers the specified global custom function.

Namespace: DevExpress.AspNetCore

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

NuGet Package: DevExpress.AspNetCore.Spreadsheet

Declaration

public static SpreadsheetOptions RegisterGlobalCustomFunction(
    this SpreadsheetOptions spreadsheetOptions,
    ICustomFunction customFunction
)

Parameters

Name Type Description
spreadsheetOptions SpreadsheetOptions

Spreadsheet options.

customFunction ICustomFunction

An object that supports the ICustomFunction interface.

Returns

Type Description
SpreadsheetOptions

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

Remarks

To create a custom function, follow the steps below.

  1. Create a class that implements the ICustomFunction interface and performs the required calculations.
  2. Pass an instance of the class to the static RegisterGlobalCustomFunction method as a parameter.
services.AddDevExpressControls(options => {
    options.AddSpreadsheet(
        spreadsheetOptions => {
            spreadsheetOptions
                .RegisterGlobalCustomFunction(new DiscountFunction());
            }
        );
});
See Also