This is a migrated thread and some comments may be shown as answers.

Docking DockPanel in DockManager

4 Answers 142 Views
Dock
This is a migrated thread and some comments may be shown as answers.
vasu
Top achievements
Rank 1
vasu asked on 26 Nov 2008, 01:19 PM
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.

4 Answers, 1 is accepted

Sort by
0
vasu
Top achievements
Rank 1
answered on 27 Nov 2008, 06:31 AM
hello
0
Julian Benkov
Telerik team
answered on 28 Nov 2008, 05:17 PM
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.
0
vasu
Top achievements
Rank 1
answered on 01 Dec 2008, 07:31 AM
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
0
Julian Benkov
Telerik team
answered on 01 Dec 2008, 09:41 AM
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.
Tags
Dock
Asked by
vasu
Top achievements
Rank 1
Answers by
vasu
Top achievements
Rank 1
Julian Benkov
Telerik team
Share this question
or