[Expand]General Information
[Expand]WinForms Controls
[Expand]ASP.NET Controls and MVC Extensions
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Collapse]WPF Controls
  Prerequisites
 [Expand]What's Installed
 [Expand].NET Core 3 Support
 [Expand]Common Concepts
 [Expand]MVVM Framework
 [Collapse]Controls and Libraries
   Reporting
  [Expand]Data Grid
  [Expand]Ribbon, Bars and Menu
  [Expand]Charts Suite
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]Tree List
  [Expand]Gauge Controls
  [Expand]Map Control
  [Expand]Layout Management
  [Expand]Windows Modern UI
  [Expand]Printing-Exporting
  [Expand]Data Editors
  [Collapse]Navigation Controls
   [Expand]Accordion Control
   [Expand]Breadcrumb Control
   [Collapse]Navigation Bar
    [Expand]Views
    [Expand]Groups
    [Collapse]Items
      Item Content Model
      Clicking and Selecting Items
     Binding to Data
    [Expand]Visual Elements
    [Expand]Miscellaneous
    [Expand]Member Tables
    [Expand]Examples
     Main Features
     Product Class Structure
    Office Navigation Bar
    TileNav Pane
    Tile Bar
   [Expand]Wizard Control
  [Expand]Spell Checker
  [Expand]Property Grid
  [Expand]PDF Viewer
  [Expand]TreeMap Control
  [Expand]Gantt Control
  [Expand]Diagram Control
  [Expand]Windows and Utility Controls
   Dialogs, Notifications and Panels
  [Expand]Scheduler (legacy)
 [Expand]Scaffolding Wizard
 [Expand]Localization
  Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Reporting
[Expand]Report and Dashboard Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]eXpress Persistent Objects
[Expand]CodeRush
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation
View this topic on docs.devexpress.com (Learn more)

Clicking and Selecting Items

When navigating through DXNavBar control items, end-users can perform specific item actions, such as clicking and selecting items.

Expanded Clicking Items

When an end-user clicks an item within the DXNavBar control, the NavBarItem.Click event is generated allowing you to respond to the user action. You can also assign a command to a NavBarItem via the NavBarItem.Command property.

Expanded Selecting Items

The automatic item selection feature allows the last clicked items to be visually indicated and programmatically identified. DXNavBar allows either a single item to be selected within the control, or each group to have its own selected item. By default, item selection is enabled, so clicking items within DXNavBar highlights them and changes their specific characteristics.

To define the item selection mode (single item or multiple items), use a combination of the NavBarControl.AllowSelectItem and NavBarControl.EachGroupHasSelectedItem properties. In addition, the NavBarControl.AllowSelectDisabledItem property can be used to allow end-users to select disabled items (items whose DXFrameworkContentElement.IsEnabled property is false). The selection state of an individual item can be identified via its NavBarItem.IsSelected property. You can also use the NavBarCommands.SelectItem command to select the item you desire.

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 item selection), NavBarViewBase.ItemSelected and NavBarItem.Select.

Single Item Selection

If the NavBarControl.AllowSelectItem property is set to true and the NavBarControl.EachGroupHasSelectedItem property is set to false, only one item can be selected within DXNavBar control. In this mode, you can determine the selected item via the control's NavBarControl.SelectedItem property.

Multiple Item Selection

If both the NavBarControl.AllowSelectItem and NavBarControl.EachGroupHasSelectedItem properties are enabled, each group can have its own selected item. In this case, a list of items selected within the control can be accessed by using the NavBarControl.SelectedItems property. Within groups, selected items can be manipulated via the NavBarGroup.SelectedItem or NavBarGroup.SelectedItemIndex property.

Expanded Member Table

Expanded Task-Based Help

Is this topic helpful?​​​​​​​