Pinning an auto hidden DockPanel

3 posts, 0 answers
  1. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 11 Oct 2007 Link to this post

    I have a DockingManger that has two DockPanels setup at design time.
    One of the DockPanels I want to allow auto hiding and pinning, the other not.  This works just fine, but I also do not want to allow other potential DockPanels to be docked to this DockingManger.  To do so I set the AllowDocking property on the DockingManger to false.

    Unfortunately a side effect of doing so prevents an auto hidden DockPanel from being re-pinned. 

    Is there a way around this?
  2. Julian Benkov
    Admin
    Julian Benkov avatar
    1135 posts

    Posted 12 Oct 2007 Link to this post

    Hello johns,

    You may use this workaround. Just handle the DockingManager DockingStateChanged event and VisisbleChanged event of desired DockPanel:

    void dockPanel1_VisibleChanged(object sender, EventArgs e) 
        if(dockPanel1.DockState == DockState.AutoHide && dockPanel1.Visible) 
        { 
            dockingManager1.AllowDocking = true
        } 
     
    private void dockingManager1_DockingStateChanged(object sender, DockingChangedEventArgs e) 
        if(e.DockObject == dockPanel1 && dockPanel1.DockState == DockState.Docked ) 
        { 
            dockingManager1.AllowDocking = false
        } 

    I hope this was helpful.
     

    Kind regards,
    Julian Benkov
    the Telerik team

    Instantly find answers to your questions at the new Telerik Support Center
  3. UI for WinForms is Visual Studio 2017 Ready
  4. johns
    johns avatar
    20 posts
    Member since:
    Jul 2007

    Posted 17 Oct 2007 Link to this post

    Thank you, that did the trick.
Back to Top