Back to Devexpress

LayoutGroup.SelectedTabIndex Property

wpf-devexpress-dot-xpf-dot-layoutcontrol-dot-layoutgroup-14889003.md

latest3.9 KB
Original Source

LayoutGroup.SelectedTabIndex Property

Gets or sets the index of the selected tabbed child among visible children. This member is in effect when the current group is rendered as a tabbed group. This is a dependency property.

Namespace : DevExpress.Xpf.LayoutControl

Assembly : DevExpress.Xpf.LayoutControl.v25.2.dll

NuGet Package : DevExpress.Wpf.LayoutControl

Declaration

csharp
public int SelectedTabIndex { get; set; }
vb
Public Property SelectedTabIndex As Integer

Property Value

TypeDescription
Int32

A zero-based integer that specifies the index of the selected tabbed child among visible children.

|

Remarks

The SelectedTabIndex member is in effect when the group is represented as a tabbed group (the LayoutGroup.View property is set to LayoutGroupView.Tabs).

You can use the SelectedTabIndex property to select a specific tab. Another way to select a tab is to use the LayoutGroup.SelectTab method.

The following code sample opens the tab2 LayoutGroup’s tab on an applicatoin startup:

xaml
<Window ...
        xmlns:lc="http://schemas.devexpress.com/winfx/2008/xaml/layoutcontrol">
    <Grid x:Name="LayoutRoot" Background="White">
        <lc:LayoutControl Orientation="Vertical" Background="#FFEAEAEA" >
            <lc:LayoutGroup Orientation="Horizontal">
                <lc:LayoutGroup Orientation="Vertical">
                    <!-- ... -->
                </lc:LayoutGroup>
                <lc:LayoutGroup View="Tabs" x:Name="tabbedgroup">
                    <lc:LayoutGroup Header="Tab 1" Orientation="Vertical" x:Name="tab1">
                        <lc:LayoutItem Label="Item 5:">
                            <TextBox Width="100" />
                        </lc:LayoutItem>
                        <lc:LayoutItem Label="Item 6:" >
                            <TextBox/>
                        </lc:LayoutItem>
                        <lc:LayoutItem Label="Item 7:" >
                            <TextBox/>
                        </lc:LayoutItem>
                    </lc:LayoutGroup>
                    <lc:LayoutGroup Header="Tab 2" x:Name="tab2">
                        <lc:LayoutItem Label="Item 8:">
                            <TextBox/>
                        </lc:LayoutItem>
                        <lc:LayoutItem Label="Item 9:">
                            <TextBox/>
                        </lc:LayoutItem>
                    </lc:LayoutGroup>
                </lc:LayoutGroup>
            </lc:LayoutGroup>
            <!-- ... -->
        </lc:LayoutControl>
    </Grid>
</Window>
csharp
public MainWindow() {
    InitializeComponent();
    tabbedgroup.SelectedTabIndex = 1;
}
vbnet
Public Sub New()
    InitializeComponent()
    tabbedgroup.SelectedTabIndex = 1
End Sub

See Also

SelectedTabChild

SelectTab(FrameworkElement)

LayoutGroup Class

LayoutGroup Members

DevExpress.Xpf.LayoutControl Namespace