DxMenu.CloseMenuOnItemClick Property
Specifies whether to close sub-menus when you click their items.
Namespace: DevExpress.Blazor
Assembly: DevExpress.Blazor.v24.2.dll
NuGet Package: DevExpress.Blazor
Declaration
[DefaultValue(null)]
[Parameter]
public bool? CloseMenuOnItemClick { get; set; }
Property Value
Type | Default | Description |
---|---|---|
Nullable<Boolean> | null | A value that specifies whether to close sub-menus when you click their items. |
Remarks
The following property values are available:
Value | Description |
---|---|
| In case of regular items, the menu closes. In case of items with templated content, the menu does not close. |
| The menu closes if a user clicks its item. |
| The menu does not close if a user clicks its item. |
The following code snippet sets the CloseMenuOnItemClick
property to false
. When a user clicks sub-items of the Products or Support items, the sub-menus do not close.
<div class="card w-auto">
<DxMenu Title="DevExpress" CloseMenuOnItemClick="false">
<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" />
</Items>
</DxMenuItem>
</Items>
</DxMenu>
</div>
See Also