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 disable tab groups in WPF DockingManager?

Platform: WPF |
Control: DockingManager |
Published Date: November 19, 2015 |
Last Revised Date: August 2, 2021 |
.NET Framework: 4.5

To restrict creating a new tab group in TDI document, the TabGroupEnabled property of the WPF DockingManager need to set to False, so that drag and drop functionality of tab will restrict and New Horizontal Tab Group and New Vertical Tab group menu items will be hidden in the context menu of the TDI document.

The same has been explained in the following code example:

XAML:

<Grid x:Name="Grid1">
    <syncfusion:DockingManager x:Name="DockingManager1" UseDocumentContainer="True" TabGroupEnabled="False"  >
        <ContentControl x:Name="content1" syncfusion:DockingManager.Header="Document1" syncfusion:DockingManager.State="Document"/>
        <ContentControl x:Name="content2" syncfusion:DockingManager.Header="Document2" syncfusion:DockingManager.State="Document"/>
         <ContentControl x:Name="content3" syncfusion:DockingManager.Header="Document3" syncfusion:DockingManager.State="Document"/>
         <ContentControl x:Name="content4" syncfusion:DockingManager.Header="Document4" syncfusion:DockingManager.State="Document"/>
     </syncfusion:DockingManager>
</Grid>
</Window>

C#

namespace DockingManager
{
    /// <summary>
    /// Interaction logic for MainWindow.xaml
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
            DockingManager dockingmanager = new DockingManager();
            ContentControl content1 = new ContentControl();
            dockingmanager.UseDocumentContainer = true;
            DockingManager.SetHeader(content1, "Document1");
            DockingManager.SetState(content1, DockState.Document);
            ContentControl content2 = new ContentControl();
            DockingManager.SetHeader(content2, "Document2");
            DockingManager.SetState(content2, DockState.Document);
            ContentControl content3 = new ContentControl();
            DockingManager.SetHeader(content3, "Document3");
            DockingManager.SetState(content3, DockState.Document);
            ContentControl content4 = new ContentControl();
            DockingManager.SetHeader(content4, "Document4");
            DockingManager.SetState(content4, DockState.Document);
        //Disable the TabGroupEnabled by setting its false, so the tabgroup will be hidden.
            dockingmanager.TabGroupEnabled = false;
            dockingmanager.Children.Add(content1);
            dockingmanager.Children.Add(content2);
            dockingmanager.Children.Add(content3);
            dockingmanager.Children.Add(content4);
            Grid1.Children.Add(dockingmanager);    
        }
    }
}

 

2X faster development

The ultimate WPF UI toolkit to boost your development speed.
ADD COMMENT
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