We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

How to add new tab at specific index poistion for WPF DockingManager?

Platform: WPF |
Control: DockingManager |
Published Date: January 29, 2016 |
Last Revised Date: August 3, 2021

You can add the document at specific index position for WPF DockingManager by setting DocumentTabOrderIndex.



//How to Add  new tab at specific index position for dockingmanager
<Window x:Class="DocumentTabOrder.MainWindow"
                 Title="DocumentTabOrderIndex" Height="350" Width="525">  
                <RowDefinition Height="40" />
           <Button Content="add tab" Height="30" Width="200" VerticalAlignment="Center" HorizontalAlignment="Center" Click="AddItem"/>
           <syncfusion:DockingManager Grid.Row="1" x:Name="dockingManager" UseDocumentContainer="True">
               <ContentControl syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Tab1"  syncfusion:DockingManager.DocumentTabOrderIndex="1">
               <ContentControl syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Tab2" syncfusion:DockingManager.DocumentTabOrderIndex="2">
               <ContentControl syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Tab3" syncfusion:DockingManager.DocumentTabOrderIndex="3">
               <ContentControl syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Tab4" syncfusion:DockingManager.DocumentTabOrderIndex="4">
               <ContentControl syncfusion:DockingManager.State="Document" syncfusion:DockingManager.Header="Tab5" syncfusion:DockingManager.DocumentTabOrderIndex="5">


//How to Add  new tab at specific index position for dockingmanager
namespace DocumentTabOrder
  public partial class MainWindow : Window
    public MainWindow()
    private void AddItem(object sender, RoutedEventArgs e)
      Grid grid1 = new Grid();
      DockingManager.SetDocumentTabOrderIndex(grid1, dockingManager.Children.Count);
      DockingManager.SetHeader(grid1, "Tab " + (dockingManager.Children.Count + 1));
      DockingManager.SetState(grid1, DockState.Document);


Adding new tab at specific position in WPF DockingManager

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
You must log in to leave a comment

Please sign in to access our KB

This page will automatically be redirected to the sign-in page in 10 seconds.

Up arrow icon

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile