Free Trial Buy Now

NavBar - Data Binding

Canon
Canon






Nikon
Nikon





Olympus
Olympus




Sony
Sony

Pentax
Pentax



v
XPath:

Description

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 NavBarCameras.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.

Version: v2011 vol 2.11
Experience the DevExpress Difference Today
To download your free evaluation copy of our award-winning ASP.NET libraries, visit the Downloads page
All DevExpress ASP.NET Controls ship as part of DXperience ASP.NET, Enterprise, and Universal.
To obtain pricing information, visit the Pricing Options page or contact us via Email at info@devexpress.com
or by telephone at +1 (818) 844-3383 between 8:30am and 5pm Pacific Time.