Log In
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]What's Installed
 [Expand]Common Concepts
 [Expand]ASP.NET WebForms Controls
 [Collapse]ASP.NET MVC Extensions
  [Expand]Product Information
  [Expand]Getting Started
  [Expand]Common Concepts
  [Expand]Grid View
  [Expand]Tree List
  [Expand]Card View
  [Expand]Pivot Grid
  [Expand]Rich Text Editor
  [Collapse]Site Navigation and Layout
     Overview - NavBar
     [Collapse]Binding to Data
       Binding to Data Overview
       Data Binding Using Mapping Properties
       Automatic Data Binding
       Unbound Mode
      Item Link Mode
      Item Bullet Style
    [Expand]Visual Elements
  [Expand]HTML Editor
  [Expand]Vertical Grid
  [Expand]Data Editors Extensions
  [Expand]Docking and Popups
  [Expand]File Management
  [Expand]Data and Image Navigation
  [Expand]Multi-Use Site Extensions
  [Expand]Query Builder
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]ASP.NET Core Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Office File API
[Expand]Report and Dashboard Server
[Expand]eXpressApp Framework
[Expand]CodeRush Classic
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Automatic Data Binding

NavBar has a built-in ability to automatically retrieve data from a data source that supports the IHierarchicalEnumerable or IHierarchicalDataSource interface. This topic describes the conditions that allow NavBar to bind automatically.

NavBar can recognize data items, and retrieve some group and item characteristics from the data fields named in a specific way. If however, any of the data-related properties of a NavBar (such as TextField, ImageUrlField, etc.) have been set, then the mapping of the associated object properties will proceed according to Data Binding Using Mapping Properties.

Expanded Data fields and group/item properties name match

During binding, NavBar implements its automatic binding ability by retrieving group/item characteristics from those data fields whose names coincide with certain property names of a MVCxNavBarGroup or MVCxNavBarItem object. The tables below list the names of the object properties that can be mapped during automatic binding, and the matching data field names you should use in the data source for mapping to work.

Data field names Group properties that can be set automatically
Enabled NavBarGroup.Enabled (via MVCxNavBarGroup.Enabled)
Expanded NavBarGroup.Expanded (via MVCxNavBarGroup.Expanded)
HeaderImageUrl ImagePropertiesBase.Url (via MVCxNavBarGroup.HeaderImage.Url)
Name NavBarGroup.Name (via MVCxNavBarGroup.Name)
NavigateUrl NavBarGroup.NavigateUrl (via MVCxNavBarGroup.NavigateUrl)
Target NavBarGroup.Target (via MVCxNavBarGroup.Target)
Text NavBarGroup.Text (via MVCxNavBarGroup.Text)
ToolTip NavBarGroup.ToolTip (via MVCxNavBarGroup.ToolTip)
Visible NavBarGroup.Visible (via MVCxNavBarGroup.Visible)
Data field names Item properties that can be set automatically
Enabled NavBarItem.Enabled (via MVCxNavBarItem.Enabled)
ImageUrl ImagePropertiesBase.Url (via MVCxNavBarItem.Image.Url)
Name NavBarItem.Name (via MVCxNavBarItem.Name)
NavigateUrl NavBarItem.NavigateUrl (via MVCxNavBarItem.NavigateUrl)
Selected NavBarItem.Selected (via MVCxNavBarItem.Selected)
Target NavBarItem.Target (via MVCxNavBarItem.Target)
Text NavBarItem.Text (via MVCxNavBarItem.Text)
ToolTip NavBarItem.ToolTip (via MVCxNavBarItem.ToolTip)
Visible NavBarItem.Visible (via MVCxNavBarItem.Visible)

The following image illustrates the process of data retrieval during automatic binding to a particular type of data source - XmlDataSource.

Expanded Binding to a Site Map

Since the properties of a System.Web.SiteMapNode object have specific names, NavBar is designed to automatically bind to a Site Map source with node attributes of similar names. In the binding process, corresponding properties of individual MVCxNavBarGroup and MVCxNavBarItem objects are automatically associated with these item attributes, and mapped accordingly. See the table below for name correspondence.

Site Map node attributes Corresponding Group object properties Corresponding Item object properties
System.Web.SiteMapNode.Description MVCxNavBarGroup.ToolTip MVCxNavBarItem.ToolTip
System.Web.SiteMapNode.Title MVCxNavBarGroup.Text MVCxNavBarItem.Text
System.Web.SiteMapNode.Url MVCxNavBarGroup.NavigateUrl MVCxNavBarItem.NavigateUrl

The structure of a Site Map allows some flexibility in the naming of item attributes. After NavBar detects the item attributes named title, url and description in the bound Site Map source, the conditions described in the above section apply.

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