We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

DockingManager Control Order

Thread ID:





93739 Mar 31,2010 09:43 AM UTC Apr 27,2010 11:32 AM UTC WinForms 10
Tags: Tools
Matt Speller
Asked On March 31, 2010 09:43 AM UTC

Hey guys,

Using the docking manager I progamatically add three controls to a form.

I dock the first to the left, the second to the right and the third to the top. The first and second are full height dock panels, and the third fills the gap between the first and second at the top.

If I dock the third to the top, and THEN dock the first and second to the left and right, the third is full width and the first and second fill the remainding height and are docked left and right respectively.

How can I determine the order to apply the docking styles. i.e. Scenario 1, I'd call DockControl with first (dockstyle:left), second (dockstyle:right) and third (dockstyle:top). The second way I'd call DockControl with third (dockstyle:top), then first (dockstyle:left) and finally second (dockstyle:right).

Ideally I would like to see a DockOrder that applies to each control that I can use to order the application of the controls to the DockManager. Is there such a property?


Vallarasu S [Syncfusion]
Replied On April 6, 2010 03:54 PM UTC

Hi Matt,

Thank you for your interest in Syncfusion Products.

The Default behavior of the Dockingmanager is that it fills the available space according to the dockstyle.

But you can redock all the control in the order with the specific control docked first.

Note:the first docked Control always occupy the entire length/width.

Vallarasu S

Matt Speller
Replied On April 12, 2010 12:35 PM UTC

Hey Vallarasu

I am aware of the behaviour. I am asking if there is a way of querying the order they are docked in - so I can recreate the dock order?


Vallarasu S [Syncfusion]
Replied On April 14, 2010 04:10 AM UTC

Hi Matt,

Thank you for the update.

You can query the dockstyle and the control in which another control is docked to, but there is no such dockorder to be determined.

DockHost dh = checkedListBox1.Parent as DockHost;
DockHostController dhc = dh.InternalController as DockHostController;
MessageBox.Show("Dock Style : " + dhc.DICurrent.dStyle.ToString());

Refer the sample in below link which demonstrates the above.


Please let me know if it helps.

Vallarasu S.

Matt Speller
Replied On April 15, 2010 08:46 AM UTC

As I explained above, and you confirmed, the docking order DOES matter. As control A docked to left before control B is docked to the top results in a different layout to when control B is first docked to the top and then control A is docked to the left. So DockingOrder is relevant. Please explain how in your code you can determine the order to apply the docking styles to the controls. When Syncfusion serialises the control layout - hows does Syncfusion iterate through the controls and know that Control B was docked before Control A? Or does Syncfusion just iterate through the control collection and store away and reapply the docking styles in the order the controls were added to the dockingmanager? In which case, how does syncfusion get around the issue that controls added to the dockingmanager may not have been docked in the order they were added? (i.e. control A and then B were added to docking manager, but B was docked to top before A was docked to left - the inverse order the enumerator will handle the controls in)

Please follow through my initial question to fully understand my issue again. This is becoming a pressing issue.



Administrator [Syncfusion]
Replied On April 15, 2010 11:35 AM UTC

I only recently found this, but you can tell the z-order of a control using the Controls.GetChildIndex

So possibly itterating through the controls collection, then getting its parent and asking the form that the dockingmanager is upon for the GetChildIndex of that parent.

Something like that :)

Clay Burch [Syncfusion]
Replied On April 15, 2010 11:48 AM UTC

You might try iterating through the dockingManager1.ControlsArray. I think the order of the controls in that array are in reverse order as they were added to the dockingManager with the DockControl method.

Attached is a little sample showing the two cases you mentioned. There are 2 forms with the controls being added in the different orders on each form. The form title shows the inverse order of the DockControl calls.


Administrator [Syncfusion]
Replied On April 15, 2010 01:35 PM UTC

I thought you could do that, but if you float a control or dock it, then add it back in again, does it change its position within the Control collection correctly?

Clay Burch [Syncfusion]
Replied On April 15, 2010 04:09 PM UTC

Yes, I think it does. As you move controls around, the order of the controls in ControlsArray changes too.

Matt Speller
Replied On April 22, 2010 10:14 AM UTC

Yes - confirmed Clay - thank you very much!

Lingaraj S [Syncfusion]
Replied On April 27, 2010 11:32 AM UTC

Hi Matt,

Thank you for your participation in Syncfusion’s Community Forums.

Lingaraj S.


This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon