Version

GetListObjectFromTab Method

Returns the object from the DataSources list that corresponds to the tab.
Syntax
'Declaration
 
Public Function GetListObjectFromTab( _
   ByVal tab As UltraTab _
) As Object
public object GetListObjectFromTab( 
   UltraTab tab
)

Parameters

tab
The tab in question.

Return Value

The object associated with the tab in the list.
Remarks
This only has meaning if the DataSource property is set.
Example
The following code demonstrates how to access some of the information passed in the event arguments of the TabDataInitialized event.

For an overview of how to handle events in Visual Basic or Visual C#, see Event Handlers in Visual Basic and Visual C#. For specific information and code examples illustrating how to consume events in your application, see Consuming Events in the .NET Framework Developer's Guide.

Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabControl

Private Sub ultraTabStripControl1_TabDataInitialized(ByVal sender As Object, ByVal e As Infragistics.Win.UltraWinTabControl.TabDataInitializedEventArgs) Handles ultraTabStripControl1.TabDataInitialized

    ' This event is raised for data bound UltraTabStripControls
    ' only. It is raised for every row in the data source.

    ' Get the associated DataRowView object
    Dim drView As DataRowView

    drView = Me.ultraTabStripControl1.GetListObjectFromTab(e.Tab)

    Dim sb As System.Text.StringBuilder

    ' Build the text string to display in the tab
    sb = New System.Text.StringBuilder()
    sb.Append(drView("CustomerID"))
    sb.Append(" - ")
    sb.Append(drView("CustomerName"))

    ' Set the tab's Text property
    e.Tab.Text = sb.ToString()

    ' Build the tooltip text for the tab
    sb = New System.Text.StringBuilder()
    sb.Append(drView("Address"))
    sb.Append(", ")
    sb.Append(drView("City"))
    sb.Append(", ")
    sb.Append(drView("Region"))
    sb.Append(", ")
    sb.Append(drView("Country"))

    ' Set the tab's ToolTipText property
    e.Tab.ToolTipText = sb.ToString()

    ' Hide tabs based on certain criteria
    If Not drView("Country") = "USA" Then
        e.Tab.Visible = False
    End If

    ' Disable tabs based on certain criteria
    If drView("City") = "Seattle" Then
        e.Tab.Enabled = False
    End If

    ' Highlight tabs based on certain criteria
    If drView("Region") = "OR" Then

        ' Set default appearance properties for this tab
        e.Tab.Appearance.ForeColor = Color.Red

        ' Set appearance properties for this tab when
        ' it is the ActiveTab (has input focus)
        e.Tab.ActiveAppearance.ForeColor = Color.Blue

        ' Set appearance properties for this tab when
        ' the mouse is over it and the control's
        ' HotTrack property is true.
        e.Tab.HotTrackAppearance.ForeColor = Color.Aqua

        ' Set appearance properties for this tab when
        ' it is the SelectedTab.
        e.Tab.SelectedAppearance.ForeColor = Color.Blue
        e.Tab.SelectedAppearance.FontData.Bold = DefaultableBoolean.True

    End If
End Sub
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabControl;

private void ultraTabStripControl1_TabDataInitialized(object sender, Infragistics.Win.UltraWinTabControl.TabDataInitializedEventArgs e)
{
	// This event is raised for data bound UltraTabStripControls
	// only. It is raised for every row in the data source.

	// Get the associated DataRowView object 
	DataRowView dataRowView = this.ultraTabStripControl1.GetListObjectFromTab( e.Tab ) as DataRowView;

	// Build the text string to display in the tab
	System.Text.StringBuilder sb = new System.Text.StringBuilder();
	sb.Append(dataRowView["CustomerID"]);
	sb.Append(" - ");
	sb.Append(dataRowView["CustomerName"]);

	// Set the tab's Text property
	e.Tab.Text = sb.ToString();

	// Build the tooltip text for the tab
	sb = new System.Text.StringBuilder();
	sb.Append(dataRowView["Address"]);
	sb.Append(", ");
	sb.Append(dataRowView["City"]);
	sb.Append(", ");
	sb.Append(dataRowView["Region"]);
	sb.Append(", ");
	sb.Append(dataRowView["Country"]);

	// Set the tab's ToolTipText property
	e.Tab.ToolTipText = sb.ToString();

	// Hide tabs based on certain criteria
	if ( (string)dataRowView["Country"] != "USA" )
		e.Tab.Visible = false;

	// Disable tabs based on certain criteria
	if ( (string)dataRowView["City"] == "Seattle" )
		e.Tab.Enabled = false;
		
	// Highlight tabs based on certain criteria
	if ( (string)dataRowView["Region"] == "OR" )
	{
		// Set default appearance properties for this tab
		e.Tab.Appearance.ForeColor = Color.Red;

		// Set appearance properties for this tab when
		// it is the ActiveTab (has input focus)
		e.Tab.ActiveAppearance.ForeColor = Color.Blue;

		// Set appearance properties for this tab when
		// the mouse is over it and the control's
		// HotTrack property is true.
		e.Tab.HotTrackAppearance.ForeColor = Color.Aqua;

		// Set appearance properties for this tab when
		// it is the SelectedTab.
		e.Tab.SelectedAppearance.ForeColor = Color.Blue;
		e.Tab.SelectedAppearance.FontData.Bold = DefaultableBoolean.True;
	}

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also