Skip to main content

SpreadsheetOptionsExtensions.RegisterGlobalCustomFunction(SpreadsheetOptions, ICustomFunction) Method

Registers the specified global custom function.

Namespace: DevExpress.AspNetCore

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


public static SpreadsheetOptions RegisterGlobalCustomFunction(
    this SpreadsheetOptions spreadsheetOptions,
    ICustomFunction customFunction


Name Type Description
spreadsheetOptions SpreadsheetOptions

Spreadsheet options.

customFunction ICustomFunction

A custom function.


Type Description

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


Follow the steps below to create a custom function.

  1. Create a class that implements the ICustomFunction interface and performs calculations.
  2. Pass an instance of the class to the static RegisterGlobalCustomFunction method as a parameter.

The example below demonstrates how to create a custom function:

builder.Services.AddSingleton<IHttpContextAccessor, HttpContextAccessor>();
builder.Services.AddDevExpressControls(options => {
    options.AddSpreadsheet( spreadsheetOptions => {
            .RegisterGlobalCustomFunction(new MyFunc());

To make a custom function available in Intellisense, add a description for this function on the client:

    function onInit(s, e){
        ASPxClientSpreadsheet.Functions.push({ name: "MYFUNC", description: "My Custom Function", arguments: [ { name: "string", description: "add some string parameter" } ] });

    .ClientSideEvents(e => {
See Also