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

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.

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

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.