Skip to main content
All docs
V24.2

ToolbarItem.GetEnabled Property

Specifies a function that determines whether the item is enabled.

Namespace: DevExpress.Blazor.Reporting.Models

Assembly: DevExpress.Blazor.v24.2.Viewer.dll

NuGet Package: DevExpress.Blazor.Viewer

Declaration

public Func<bool> GetEnabled { get; set; }

Property Value

Type Description
Func<Boolean>

A function that returns True if an item is enabled; otherwise, false.

Remarks

The following code hides the Export To drop-down list in the toolbar:

@using DevExpress.Blazor.Reporting.Models;
// ...
<DxReportViewer @ref="reportViewer" OnCustomizeToolbar="OnCustomizeToolbar"></DxReportViewer>

@code {
    DxReportViewer reportViewer;

    void OnCustomizeToolbar(ToolbarModel toolbarModel)
    {
        foreach (var item in toolbarModel.AllItems)
        {
            if (item.Id == "ExportTo")
            {
                item.GetEnabled = () => { return false; };
                item.Visible = false;
            }
        }
    }
}

Implements

See Also