Skip to main content
Tab

ASPxTabControl.TabDataBound Event

Occurs after a tab has been bound to a data source.

Namespace: DevExpress.Web

Assembly: DevExpress.Web.v23.2.dll

NuGet Package: DevExpress.Web

Declaration

public event TabControlEventHandler TabDataBound

Event Data

The TabDataBound event's data class is TabControlEventArgs. The following properties provide information specific to this event:

Property Description
Tab Gets a tab object related to the event.

Remarks

The TabDataBound event is raised for each tab after it’s data bound to the corresponding data from the specified data source. This event enables you to customize settings of the related tab before it is finally rendered. Handling the TabDataBound event correctly you can, for example, implement a custom logic to dynamically map properties of a tab control’s tabs to the required data fields.

The processed tab can be accessed by using the TabControlEventArgs.Tab property of the event’s argument.

If the control functions in unbound mode, the TabDataBound event isn’t raised.

Example

This example demonstrates how to use the ASPxTabControl.TabDataBound event.

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" 
Inherits="_Default" %>
<%@ Register assembly="DevExpress.Web.v8.3, Version=8.3.2.0, Culture=neutral, 
PublicKeyToken=b88d1754d700e49a" namespace="DevExpress.Web.ASPxTabControl" tagprefix="dxtc" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
    protected void Page_Load(object sender, EventArgs e){
    }
    protected void ASPxTabControl1_TabDataBound(object source, 
        DevExpress.Web.TabControlEventArgs e) {
        e.Tab.Text = "About " + e.Tab.Text;
    }
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title></title>
</head>
<body>
    <form id="form1" runat="server">
    <div>

        <dxtc:ASPxTabControl ID="ASPxTabControl1" runat="server" 
            DataSourceID="XmlDataSource1" NavigateUrlField="id" 
            NavigateUrlFormatString="?id={0}" ontabdatabound="ASPxTabControl1_TabDataBound">
        </dxtc:ASPxTabControl>
        <asp:XmlDataSource ID="XmlDataSource1" runat="server" 
            DataFile="~/App_Data/TabControlData.xml" XPath="//product">
        </asp:XmlDataSource>

    </div>
    </form>
</body>
</html>
See Also