Docking DockPanel in DockManager

5 posts, 0 answers
  1. vasu
    vasu avatar
    4 posts
    Member since:
    Nov 2008

    Posted 26 Nov 2008 Link to this post

    I have taken four dockpanels( docked to left docking zone) in a docking manager, if i pin any of the dockpanel,  how can i auto hide any of the already pinned dockpanel. Now what i am getting when i pin another dockpanel is, it is pinned next to the already pinned dockpanel.
  2. vasu
    vasu avatar
    4 posts
    Member since:
    Nov 2008

    Posted 27 Nov 2008 Link to this post

    hello
  3. UI for WinForms is Visual Studio 2017 Ready
  4. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 28 Nov 2008 Link to this post

    Hi vasu,

    When you pin one tab group with DockPanels, you can unpin one of them and all DockPanels from this group will go in AutoHide state.

    You can also do this by using the DockState property of one of the DockPanels in this tab group.

    Sincerely yours,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  5. vasu
    vasu avatar
    4 posts
    Member since:
    Nov 2008

    Posted 01 Dec 2008 Link to this post

    Hi Benkov,

    Thanks for the reply, i have worked with the tab group model what you have said but, what i need here is the dock panels are not to be grouped in one panel.  So each panel is initialy docked to the left docking zone and from their if you pin one panel, if any of the panel that is already pinned should be in autohide state such that no two dockpanels are pinned at a time.

    Sincerely yours,
    Vasu
  6. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 01 Dec 2008 Link to this post

    Hello Vasu,

    You can use the following code snippet for this scenario:

    public partial class DockForm : Form 
        public DockForm() 
        { 
            InitializeComponent(); 
        } 
     
        private bool processAutoHideLogic = false
     
        protected override void OnShown(EventArgs e) 
        { 
            base.OnShown(e); 
            foreach (DockPanel dockPanel in this.dockingManager1.GetManagedDockables()) 
            { 
                if (dockPanel != this.dockPanel1 && dockPanel.DockState != DockState.AutoHide) 
                { 
                    dockPanel.DockState = DockState.AutoHide; 
                } 
            } 
     
            this.processAutoHideLogic = true
        } 
     
        private void dockingManager1_DockingStateChanged(object sender, DockingChangedEventArgs e) 
        { 
            if (this.processAutoHideLogic && e.DockState == DockState.Docked) 
            { 
                foreach (DockPanel dockPanel in this.dockingManager1.GetManagedDockables()) 
                { 
                    if (e.DockObject != dockPanel && dockPanel.DockState != DockState.AutoHide) 
                    { 
                        dockPanel.DockState = DockState.AutoHide; 
                    } 
                } 
            } 
        } 


    Kind regards,
    Julian Benkov
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top
UI for WinForms is Visual Studio 2017 Ready