Log In
Home
Support
Demos
Documentation
Blogs
Training
Webinars
[Expand]General Information
[Expand]WinForms Controls
[Collapse]ASP.NET Controls and MVC Extensions
 [Expand]Prerequisites
 [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]Card View
  [Expand]Vertical Grid
  [Expand]Spreadsheet
  [Expand]Rich Text Editor
  [Expand]HTML Editor
  [Expand]Image and Data Browsing
  [Expand]Docking and Popups
  [Collapse]Navigation and Layout Extensions
   [Expand]FormLayout
   [Expand]Menu
   [Expand]NavBar
   [Expand]Ribbon
   [Expand]PageControl
   [Expand]TabControl
   [Collapse]PopupMenu
     Overview - PopupMenu
    [Collapse]Concepts
     [Collapse]Binding to Data
       Binding to Data Overview
       Data Binding Using Mapping Properties
       Automatic Data Binding
       Unbound Mode
      Templates
    [Expand]Visual Elements
   [Expand]Splitter
   [Expand]TreeView
   [Expand]Panel
  [Expand]File Management
  [Expand]Multi-Use Site Extensions
  [Expand]Charts
  [Expand]Pivot Grid
  [Expand]Scheduler
  [Expand]Tree List
  [Expand]Data Editor Extensions
  [Expand]Report Extensions
  [Expand]SpellChecker
 [Expand]Localization
 [Expand]Redistribution and Deployment
  Get More Help
 [Expand]API Reference
[Expand]ASP.NET Bootstrap Controls
[Expand]WPF Controls
[Expand]Xamarin Controls
[Expand]Windows 10 App Controls
[Expand]Document Server
[Expand]Reporting
[Expand]Report Server
[Expand]Dashboard
[Expand]eXpressApp Framework
[Expand]CodeRush
[Expand]Cross-Platform Core Libraries
[Expand]Tools and Utilities
 End-User Documentation

Automatic Data Binding

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

A PopupMenu can recognize data items and retrieve some item characteristics from the data fields named in a specific way. If however, any of the data-related properties of a PopupMenu (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 field and item property name match

During binding, a PopupMenu implements its automatic binding ability by retrieving item characteristics from those data fields whose names coincide with certain property names of a MVCxMenuItem 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 Item properties that can be set automatically
BeginGroup MenuItem.BeginGroup (via MVCxMenuItem.BeginGroup)
Enabled MenuItem.Enabled (via MVCxMenuItem.Enabled)
ImageUrl ImagePropertiesBase.Url (via MVCxMenuItem.Image.Url)
Name MenuItem.Name (via MVCxMenuItem.Name)
NavigateUrl MenuItem.NavigateUrl (via MVCxMenuItem.NavigateUrl)
Selected MenuItem.Selected (via MVCxMenuItem.Selected)
Target MenuItem.Target (via MVCxMenuItem.Target)
Text MenuItem.Text (via MVCxMenuItem.Text)
ToolTip MenuItem.ToolTip (via MVCxMenuItem.ToolTip)

Expanded Binding to a Site Map

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

Site Map node attributes Corresponding Item object properties
System.Web.SiteMapNode.Description MVCxMenuItem.ToolTip
System.Web.SiteMapNode.Title MVCxMenuItem.Text
System.Web.SiteMapNode.Url MVCxMenuItem.NavigateUrl
Note

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

How would you rate this topic?​​​​​​​