RadTabStrip for ASP.NET

RadTabStrip Send comments on this topic.
TabDataBound Event
See Also  Example
Telerik.WebControls Namespace > RadTabStrip Class : TabDataBound Event


Occurs after a tab is data bound. 

Example

The following example demonstrates how to map fields from the data item to tab properties using the TabDataBound event. 

Event Data

The event handler receives an argument of type TabStripEventArgs containing data related to this event. The following TabStripEventArgs properties provide information specific to this event.

PropertyDescription
Tab Gets the referenced Tab in the RadTabStrip control when the event is raised.
 

 

Namespace: Telerik.WebControls
Assembly: RadTabStrip (in RadTabStrip.dll)

Syntax

Visual Basic (Declaration) 
Public Event TabDataBound() As TabStripEventHandler
Visual Basic (Usage)Copy Code
Dim instance As RadTabStrip
Dim handler As TabStripEventHandler
 
AddHandler instance.TabDataBound, handler
C# 
public event TabStripEventHandler TabDataBound()
 

Event Data

The event handler receives an argument of type TabStripEventArgs containing data related to this event. The following TabStripEventArgs properties provide information specific to this event.

PropertyDescription
Tab Gets the referenced Tab in the RadTabStrip control when the event is raised.

Example

The following example demonstrates how to map fields from the data item to tab properties using the TabDataBound event.
C#Copy Code
private void RadTabStrip1_TabDataBound(object sender, Telerik.WebControls.TabStripEventArgs e)
{
   Tab tab = e.Tab;
   DataRowView dataRow = (DataRowView) e.Tab.DataItem;

   tab.ImageUrl =
"image" + dataRow["ID"].ToString() + ".gif";
   tab.NavigateUrl = dataRow[
"URL"].ToString();
}
    
Visual BasicCopy Code
Sub RadTabStrip1_TabDataBound(ByVal sender As Object, ByVal e As TabStripEventArgs) Handles RadTabStrip1.TabDataBound
    Dim tab As Tab = e.Tab
    Dim dataRow As DataRowView = CType(e.Tab.DataItem, DataRowView)

    tab.ImageUrl = "image" + dataRow("ID").ToString() + ".gif"
    tab.NavigateUrl = dataRow("URL").ToString()
End Sub

Remarks

The TabDataBound event is raised for each tab upon databinding. You can retrieve the tab being bound using the event arguments. The DataItem associated with the tab can be retrieved using the DataItem property.

The TabDataBound event is often used in scenarios when you want to perform additional mapping of fields from the DataItem to their respective properties in the Tab class.

Requirements

Platforms: Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

See Also