Skip to main content
All docs
V25.1
  • DataInspectorOptionBuilder.OnGridInitialized(String) Method

    A handler for the event that occurs before the Grid widget’s content is loaded.

    Namespace: DevExpress.DashboardAspNetCore

    Assembly: DevExpress.Dashboard.v25.1.AspNetCore.dll

    NuGet Package: DevExpress.AspNetCore.Dashboard

    Declaration

    public DataInspectorOptionBuilder OnGridInitialized(
        string onGridInitialized
    )

    Parameters

    Name Type Description
    onGridInitialized String

    A function used in JavaScript frameworks to save the widget instance.

    Returns

    Type Description
    DataInspectorOptionBuilder

    A reference to this instance after the operation has completed.

    Remarks

    The Data Inspector uses the DevExtreme DataGrid to display raw or aggregated data.

    To customize the Grid widget, enable the Data Inspector (set the AllowInspectAggregatedData(Boolean) / AllowInspectRawData(Boolean) properties to true) and handle the DataGrid’s onInitialized event:

    <div style="position: absolute; left: 0; top: 0; right: 0; bottom: 0;">
    @(Html.DevExpress().Dashboard("dashboardControl1")
        .Width("100%")
        .Height("100%")
        .UseNeutralFilterMode(true)
        .OnBeforeRender("onBeforeRender")
        .Extensions(x => x.DataInspector(y => y.AllowInspectAggregatedData(true).AllowInspectRawData(true).OnGridInitialized("onGridInitialized")))
    )
    </div>
    

    Use the event’s component property to obtain the DataGrid instance. The following code snippet shows how to change the DataGrid options (enable export):

    function onGridInitialized(args) {
        args.component.option({
            export: {
                enabled: true
            }
        });
    }
    

    Note that client-side export in the DataGrid widget requires the ExcelJS v4+ and FileSaver third-party libraries.

    See Also