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;
}
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
Any progress on researching this?
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.
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?
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
That is exactly what I want. Thank you!
Hi Martin,
Regards,
Bagavathi Perumal A