Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxMenuItem.CloseMenuOnClick Property

Specifies whether to close a sub-menu when you click the item.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(null)]
[Parameter]
public bool? CloseMenuOnClick { get; set; }

#Property Value

Type Default Description
Nullable<Boolean> null

A value that specifies whether to close a sub-menu when you click the item.

#Remarks

The following property values are available:

Value

Description

null

In case of regular items, the menu closes.

In case of items with templated content, the menu does not close.

true

The menu closes if a user clicks its item.

false

The menu does not close if a user clicks its item.

The following code snippet sets the CloseMenuOnClick property to false for the Best Practices item. When a user selects this item, the Support menu does not close.

Razor
<div class="card w-auto">
    <DxMenu Title="DevExpress">
        <Items>
            <DxMenuItem Text="Products" IconCssClass="oi oi-layers">
                <Items>
                    <DxMenuItem Text="Subscriptions / Packs" />
                    <DxMenuItem Text=".NET Windows Forms Components" />
                    <DxMenuItem Text="Reporting / Printing Suites" />
                    <DxMenuItem Text="VCL Components and Tools" />
                    <DxMenuItem Text="ASP.NET Components" />
                </Items>
            </DxMenuItem>
            <DxMenuItem Text="Support" IconCssClass="oi oi-person">
                <Items>
                    <DxMenuItem Text="Knowledge Base" />
                    <DxMenuItem Text="Documentation" />
                    <DxMenuItem Text="Support Center" />
                    <DxMenuItem Text="Newsgroups" />
                    <DxMenuItem Text="Best Practices" CloseMenuOnClick="false" />
                </Items>
            </DxMenuItem>
        </Items>
    </DxMenu>
</div>
See Also