How to set vertical stacking of pinned docked panels

I have a Winforms application where I have to create the DockingManager manually in code. I have code to create a panel and dock it to the left side, but I also want to specify that the docked panels stack vertically when multiple are pinned, instead of the default behavior of the pinned panels stacking horizontally. My code below is how I create the panels :


Panel CreateDockedPanel(string name, DockingStyle ds)
{
Panel p = new();
Controls.Add(p);
dmDM.SetEnableDocking(p, true);
dmDM.SetAutoHideOnLoad(p, true);
dmDM.SetDockLabel(p, name);
dmDM.DockControlInAutoHideMode(p, ds, 200);


return p;
}

7 Replies

BA BagavathiPerumal Apranandham Syncfusion Team July 12, 2022 03:57 PM UTC

Hi Pfhonix,


We are validating your reported query. We will validate and update you in two business days. We appreciate your patience until then.



Regards,
Bagavathi Perumal A



MA Martin replied to BagavathiPerumal Apranandham July 14, 2022 07:46 PM UTC

Any progress on researching this?



GT Gokul Thanudhas Syncfusion Team July 15, 2022 07:03 AM UTC

Hi Martin,


Sorry for the delay in getting back to you.

You can achieve your requirement by arranging panels vertically before moving to AutoHide state. When you dock the panel again, it will be arranged vertically. Please refer to the sample and video.


Regards,

Gokul T.






Attachment: DockingManager_8284faa8.zip


MA Martin July 15, 2022 03:19 PM UTC

Arranging the tiles manually before autohiding isn't a solution. I don't want to force the user to use docked panel they don't want to see. I want a docked panel to stack vertically with any currently pinned window when the user wants to pin another hidden panel.

Can you point me to parts of the API where notifications for when controls are pinned and how to programmatically change the dock location/position?



GT Gokul Thanudhas Syncfusion Team July 19, 2022 05:53 AM UTC

Hi Martin,


1.DockStateChanging event and DockStateChanged event will be triggered when the AutoHide tab is pinned. Please refer to the documentation for your reference.


https://help.syncfusion.com/windowsforms/docking-manager/docking-events#notify-dock-state-change


2. Using the DockControl function you can able to set the change the position programmatically.


public virtual void DockControl(Control ctrl, Control parent, DockingStyle dockstyle, int size)


You can arrange the dock state control one below the other by using the above function.


for example
If you use the below code the panel 2 will be docked below the panel 1.


this.dockingManager1.DockControl(this.panel2,this.panel1, Syncfusion.Windows.Forms.Tools.DockingStyle.Bottom, 100);




 Please refer the below documentation link for your reference.


  https://help.syncfusion.com/windowsforms/docking-manager/dock-window#change-dock-side-of-children


Regards,

Gokul T






MA Martin July 20, 2022 03:27 PM UTC

That is exactly what I want. Thank you!



BA BagavathiPerumal Apranandham Syncfusion Team July 21, 2022 01:03 PM UTC

Hi Martin,


We hope that your issue is resolved. Please let us know if you need any other assistance. We are happy to assist you.



Regards,
Bagavathi Perumal A


Loader.
Up arrow icon