ASPxClientTabControlBase.GetTab(index) Method
Returns a tab specified by its index.
Declaration
GetTab(
index: number
): ASPxClientTab
Parameters
Name | Type | Description |
---|---|---|
index | number | The index of the tab object to retrieve. |
Returns
Type | Description |
---|---|
ASPxClientTab | An ASPxClientTab object representing the tab located at the specified index within the control’s ASPxTabControl.Tabs collection. |
Remarks
The tab control’s client-side functionality allows its tabs to be accessed programmatically on the client side. This method gets a client tab object specified by the index it has within the ASPxTabControl.Tabs collection.
Note that the index parameter is zero-based and its upper available value is specified by the ASPxClientTabControlBase.GetTabCount value decremented by one. If an invalid index is passed via the parameter, the method returns null.
This method can be used together with the ASPxClientTabControlBase.GetTabCount method when iterating through the tab control’s tab list.
Example
...
<dxtc:ASPxPageControl ID="ASPxPageControl1" runat="server"
ActiveTabIndex="0" ClientInstanceName="pageControl">
<TabPages>
<dxtc:TabPage Text="Tab 1">
<ContentCollection>
<dxw:ContentControl runat="server">
<dxe:ASPxCheckBox ID="ASPxCheckBox1" runat="server" Text="Show Tab 2">
<ClientSideEvents CheckedChanged="function(s, e) {
var tab = pageControl.GetTab(1);
var isVisible = s.GetChecked();
tab.SetVisible(isVisible);
}" />
</dxe:ASPxCheckBox>
</dxw:ContentControl>
</ContentCollection>
</dxtc:TabPage>
<dxtc:TabPage ClientVisible="False" Text="Tab 2">
<ContentCollection>
<dxw:ContentControl runat="server">
<dxe:ASPxLabel ID="ASPxLabel1" runat="server" Text="Label on Tab 2">
</dxe:ASPxLabel>
</dxw:ContentControl>
</ContentCollection>
</dxtc:TabPage>
</TabPages>
</dxtc:ASPxPageControl>
...