Show theme settings Shopping cart Download trialFree Trial
Change Theme Settings
Change Theme Settings
Show All Themes

Data Binding

This demo illustrates how the ASPxTabControl can be populated with tab information taken from a data source. The ASPxTabControl supports standard data binding - any object that implements the IHierarchicalEnumerable or IHierarchicalDataSource interface (e.g. SiteMapDataSource, XmlDataSource) may be used as a data source for this control.

In this sample, the ASPxTabControl control is bound to the XmlDataSource component that obtains data from an xml file with the following structure.

    <Product Name="..." Text="..." ID="..." />

The ASPxTabControl implements specific properties that point to the data fields containing the necessary data. These are the NameField, NavigateUrlField, TabImageUrlField, ActiveTabImageUrlField, TextField and ToolTipField properties. If these properties are not defined, the ASPxTabControl is able to automatically bind to data fields whose names coincide with property names of a Tab object (such as the Name, NavigateUrl, TabImage.Url, ActiveTabImage.Url, Text and ToolTip).

In this demo, navigate locations for tabs are composed by formatting values of the 'id' data field in a specific manner. The 'id' data field is pointed by the NavigateUrlField property, and a format string is defined via the NavigateUrlFormatString property.

Local Copy of this Demo
To inspect the source code for this demo on your machine, you must first install our components via the DevExpress Component Installer.
You can open a local copy of this online demo directly from this webpage (if using v20.2.8, 21.1.4 or higher).
Open CS Solution
Open VB Solution
The source code files for this demo are installed (by default) in the following directories:
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\CS\ASPxNavigationAndLayoutDemos
\Users\Public\Documents\DevExpress Demos XX.X\Components\ASP.NET\VB\ASPxNavigationAndLayoutDemos