blazor-devexpress-dot-blazor-dot-dxtoolbaritem-cc4a0e6a.md
Specifies whether to close a sub-menu when you click the item.
Namespace : DevExpress.Blazor
Assembly : DevExpress.Blazor.v25.2.dll
NuGet Package : DevExpress.Blazor
[DefaultValue(null)]
[Parameter]
public bool? CloseMenuOnClick { get; set; }
| Type | Default | Description |
|---|---|---|
| Nullable<Boolean> | null |
A value that specifies whether to close a sub-menu when you click the item.
|
The following property values are available:
|
Value
|
Description
| | --- | --- | |
null
|
In case of regular items, the menu closes.
In case of checked buttons and items with templated content, the menu does not close.
If an item has subitems and its SplitDropDownButton property is set to false, the menu does not close when a user clicks this item. If the SplitDropDownButton property is set to true, the menu closes when a user clicks the item’s main action button.
| |
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 Times New Roman item. When a user selects this item, the Format menu does not close.
<DxToolbar>
<Items>
<DxToolbarItem GroupName="align" IconCssClass="oi oi-align-left" />
<DxToolbarItem GroupName="align" IconCssClass="oi oi-align-center" />
<DxToolbarItem GroupName="align" IconCssClass="oi oi-align-right" />
<DxToolbarItem Text="Format" BeginGroup="true">
<Items>
<DxToolbarItem Text="Times New Roman" CloseMenuOnClick="false"/>
<DxToolbarItem Text="Tahoma" />
<DxToolbarItem Text="Verdana" />
</Items>
</DxToolbarItem>
</Items>
</DxToolbar>
See Also