TabControl - Automatic Data Binding to an XML file
This sample demonstrates how to bind the ASPxTabControl to data without manually setting the control's data-related properties.
The ASPxTabControl's data source is set to an XmlDataSource component that is used to retrieve data from an XML file. The XmlDataSource's XPath property is defined explicitly.
Based on the source data, the ASPxTabControl populates its Tabs collection with automatically created Tab objects. Tab object characteristics (such as text, image, navigate location, tooltip text, etc.) are obtained from the XML file's node attributes.This example demonstrates the ASPxTabControl's ability to automatically retrieve tab characteristics from node attributes whose names coincide with property names of a Tab object. For this purpose, node attributes are named asActiveTabImageUrl,Name,NavigateUrl, TabImageUrl, Text and ToolTip in this demo. Note that the name match is not case sensitive.
<dx:ASPxTabControl ID="ASPxTabControl1" runat="server"
DataSourceID="XmlDataSource1" />
<asp:XmlDataSource ID="XmlDataSource1" runat="server"
DataFile="~/App_Data/TabControlDataSource.xml" XPath="platforms/*"></asp:XmlDataSource>
<?xml version="1.0" encoding="utf-8" ?>
<platforms>
<platform Name="WinForms" NavigateUrl="javascript: void(0);" TabImageUrl="~/Images/WinForms_ini.png" ActiveTabImageUrl="~/Images/WinForms_Active.png" Text="WinForms" ToolTip="WinForms Controls and Libraries"></platform>
<platform Name="ASP" NavigateUrl="javascript: void(1);" TabImageUrl="~/Images/ASP_ini.png" ActiveTabImageUrl="~/Images/ASP_Active.png" Text="ASP.NET Controls" ToolTip="ASP.NET Controls and Libraries"></platform>
<platform Name="VCL" NavigateUrl="http://devexpress.com/Products/VCL/" TabImageUrl="~/Images/VCL_ini.png" ActiveTabImageUrl="~/Images/VCL_Active.png" Text="Delphi VCL Controls" ToolTip="Delphi and C++ Builder Controls"></platform>
</platforms>