[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
    [Expand]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)

Binding to Data

The DXNavBar control can obtain group and item information from a data source. For this purpose, you can use the NavBarControl.ItemsSource property - to specify the source of the data, and the NavBarControl.GroupDescription property - to specify the name of a data source field, by which the values of data source items should be grouped within the NavBarControl.

Expanded Example of Data Binding

Below is a simple example that demonstrates how a NavBarControl can be easily bound to a simple, plain data table containing two columns ("Group" and "Item") and how the NavBarControl visualizes the table data by grouping them by the "Group" column values.

In this example, a table with the following data content is created:

Group Item
Group 1 Item 1-1
Group 1 Item 1-2
Group 1 Item 1-3
Group 2 Item 2-1
Group 2 Item 2-2
Group 2 Item 2-3

Note that in the code below, the created data source object is defined as the data context for the window. Particular properties of group and item objects are bound to the required data using styles.

The following image illustrates the result.

Expanded See Also

To learn more, you can refer to the DXNavBar's "Data Binding" demo supplied with the installation. It can also be accessed online at: http://demos.devexpress.com/DXNavBarDemos/

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