Skip to main content

NavBarControl.AllowSelectItem Property

Gets or sets a value specifying whether items can be selected. This is a dependency property.

Namespace: DevExpress.Xpf.NavBar

Assembly: DevExpress.Xpf.NavBar.v23.2.dll

NuGet Package: DevExpress.Wpf.NavBar

Declaration

public bool AllowSelectItem { get; set; }

Property Value

Type Description
Boolean

true if items can be selected; otherwise false.

Remarks

Set the AllowSelectItem property to true to enable item selection. If it is enabled, clicking an item selects it. Otherwise, items cannot be selected. Use the NavBarControl.AllowSelectDisabledItem property to control whether disabled items (whose DXFrameworkContentElement.IsEnabled property is false) can also be selected. The NavBarControl.EachGroupHasSelectedItem property specifies whether all or only current group items are deselected when selecting an item.

Items can also be selected via code. Selected items have their NavBarItem.IsSelected property set to true. You can use the NavBarControl.SelectedItem or NavBarGroup.SelectedItem (NavBarGroup.SelectedItemIndex) property to specify a single selected item within the NavBarControl. In addition, you can use the NavBarCommands.SelectItem command or the NavBarViewBase.SelectItem method. When multiple item selection is enabled, the selected items are stored within a collection that can be accessed via the NavBarControl.SelectedItems property.

Commonly, when an end-user clicks an item to select it, you can respond to this action by handling specific events occurring in the following order: NavBarViewBase.Click, NavBarViewBase.ItemSelecting (this event allows you to cancel the item selection), and NavBarViewBase.ItemSelected.

See the Clicking and Selecting Items topic to learn more.

See Also