Click or drag to resize
KaxTabControlSelectedIndex Property
Gets or sets the index of the selected child tab.

Namespace: Kettic.AspNet.Controls
Assembly: Kettic.AspNet.Controls (in Kettic.AspNet.Controls.dll) Version: 2014.4.1129.0 (2014.04.1129.0)
Syntax
public int SelectedIndex { get; set; }

Property Value

Type: Int32
The zero based index of the selected tab. The default value is -1 (no child tab is selected).

Implements

IKaxTabContainerSelectedIndex
Remarks
Use the SelectedIndex property to programmatically specify the selected child tab in a IKaxTabContainer (KaxTabControl or KaxTab). To clear the selection set the SelectedIndex property to -1.
Examples
The following example demonstrates how to programmatically select a tab by using the SelectedIndex property.
void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        KaxTab newsTab = new KaxTab("News");
        KaxTabControl1.Tabs.Add(newsTab);

        KaxTabControl1.SelectedIndex = 0; //This will select the "News" tab

        KaxTab cnnTab = new KaxTab("CNN");
        newsTab.Tabs.Add(cnnTab);

        KaxTab nbcTab = new KaxTab("NBC");
        newsTab.Tabs.Add(nbcTab);

        newsTab.SelectedIndex = 1; //This will select the "NBC" child tab of the "News" tab
    }
}
See Also