Change Theme Settings
Change Theme Settings
Themes
 
Show All Themes
v
...v

Data Binding

v
XPath: /Cameras/*

This demo illustrates how you can bind the ASPxNavBar to a data source. The ASPxNavBar control supports standard data binding. In this instance any object which implements the IHierarchicalEnumerable or IHierarchicalDataSource interface (e.g. SiteMapDataSource, XmlDataSource) may be used as a data source for this control.

In this demo, the navbar control is bound to a standard data source of the type XmlDataSource. This data source supplies the navbar with data from a specific Cameras.xml file. The ASPxNavBar requires data to be represented as different navbar items combined into groups. Use the data source's XPath property to obtain the desired sample of data. (See ASPX code)

Note that the text within each navbar item is composed by using the navbar's template of the type ItemTextTemplate.

Our web controls provide you the ability to bind the properties of the controls that compose a template directly to the properties of the corresponding data object (DataItem) from the bound data source. For this purpose, the Container.Item.DataItem property or the Container.EvalDataItem(<expression>) method can be used. Refer to ASPX code to see how the properties of child controls which populate the navbar's template of the ItemTextTemplate type are bound directly to the specific data of the XmlDataSource's node by using the Container.EvalDataItem(<expression>) method.