Enumerator used to determine how tabs will be sorted in a data bound
UltraTabStripControl.
Syntax
| Visual Basic (Declaration) | |
|---|
Public Enum SortDirection
Inherits Enum |
| C# | |
|---|
public enum SortDirection : Enum |
Members
Example
The following code demonstrates how to set non-default values for many of the properties on the UltraTabStripControl.
| Visual Basic | Copy Code |
|---|
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinTabs
Imports Infragistics.Win.UltraWinTabControl
Private Sub InitializeTabStripControl()
With Me.ultraTabStripControl1
.TabHeaderAreaAppearance.ImageBackground = Me.BackgroundImage
.TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form
.HotTrack = True
.TabLayoutStyle = TabLayoutStyle.MultiRowTabsPerRow
.MultiRowSelectionStyle = MultiRowSelectionStyle.HighlightTab
.TabsPerRow = 4
.MaxVisibleTabRows = 5
.InterTabSpacing = New DefaultableInteger(3)
.InterRowSpacing = New DefaultableInteger(5)
.TabPageMargins.Top = 2
.TabPageMargins.Left = 2
.TabPageMargins.Right = 2
.TabPageMargins.Bottom = 2
.TabKeyMember = "CustomerID"
.TabTextMember = "CustomerName"
.ToolTipTextMember = "Address"
.SortMember = "CustomerName"
.SortDirection = SortDirection.Descending
Me.CreateData()
.SetDataBinding(Me.dataSource, "")
End With
End Sub
|
| C# | Copy Code |
|---|
using System.Diagnostics;
using Infragistics.Win;
using Infragistics.Win.UltraWinTabs;
using Infragistics.Win.UltraWinTabControl;
private void InitializeTabStripControl()
{
// Set the image background to conform and align with the
// form's BackgroundImage
this.ultraTabStripControl1.TabHeaderAreaAppearance.ImageBackground = this.BackgroundImage;
this.ultraTabStripControl1.TabHeaderAreaAppearance.ImageBackgroundOrigin = ImageBackgroundOrigin.Form;
// Enable hot tracking (tabs hightlight as the mouse passes over
them)
this.ultraTabStripControl1.HotTrack =
true;
// Set the layout style of the tabs to a multi-row style
this.ultraTabStripControl1.TabLayoutStyle =
TabLayoutStyle.MultiRowTabsPerRow;
// Set the MultiRowSelectionStyle to highlight the selected tab
this.ultraTabStripControl1.MultiRowSelectionStyle =
MultiRowSelectionStyle.HighlightTab;
// Set the # of tabs per row
this.ultraTabStripControl1.TabsPerRow = 4;
// Set the max # of visible rows to show
this.ultraTabStripControl1.MaxVisibleTabRows = 4;
// Set the spacing between tabs of the same row and between
// tab rows
this.ultraTabStripControl1.InterTabSpacing = 3;
this.ultraTabStripControl1.InterRowSpacing = 5;
// Note: The following code does the same
//this.ultraTabStripControl1.InterTabSpacing = new
DefaultableInteger( 3 );
//this.ultraTabStripControl1.InterRowSpacing = new
DefaultableInteger( 5 );
// Note: the following code sets the spacing back to there
// default values
//this.ultraTabStripControl1.InterTabSpacing =
DefaultableInteger.Default;
//this.ultraTabStripControl1.InterRowSpacing =
DefaultableInteger.Default;
// Set the margins around the tab page.
this.ultraTabStripControl1.TabPageMargins.Top = 2;
this.ultraTabStripControl1.TabPageMargins.Left = 2;
this.ultraTabStripControl1.TabPageMargins.Right = 2;
this.ultraTabStripControl1.TabPageMargins.Bottom = 2;
// Set the TabKeyMember. This will automatically initialize
// each tab's Key property to the data value in that column.
this.ultraTabStripControl1.TabKeyMember
= "CustomerID";
// Set the TabTextMember. This will automatically initialize
// each tab's Text property to the data value in that column.
this.ultraTabStripControl1.TabTextMember
= "CustomerName";
// Set the ToolTipTextMember. This will automatically
initialize
// each tab's ToolTipText property to the data value in that
column.
this.ultraTabStripControl1.ToolTipTextMember = "Address";
// Set the SortMember. This will automatically sort the tabs
// based on the data values in that column.
this.ultraTabStripControl1.SortMember
= "CustomerName";
// Set the direction of the sort.
this.ultraTabStripControl1.SortDirection
= SortDirection.Descending;
// Create an in-memory data source
this.CreateData();
// Bind the tab strip to the data source
// Note: This clears the Tabs collection and re-populates it
// with a tab for every row in the data source.
this.ultraTabStripControl1.SetDataBinding( this.dataSource, ""
);
// Note: Calling SetDataBinding is the same as setting the
// DataSource and DataMember
properties individually
// but it does it in one
atomic operation.
//this.ultraTabStripControl1.DataSource = this.dataSource;
//this.ultraTabStripControl1.DataMember = "";
// Set the data bindings for some textboxes
//this.txtCustomerID.DataBindings.Add("Text", this.dataSource,
"CustomerID");
//this.txtCustomerName.DataBindings.Add("Text", this.dataSource,
"CustomerName");
}
|
See Also