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. Image for the cookie policy date
close icon

DockingManager Control Order

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?

Matt

10 Replies

VS Vallarasu S Syncfusion Team 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.


Regards
Vallarasu S


MS Matt Speller 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?

Matt


VS Vallarasu S Syncfusion Team 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.

http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DockingmanagerDockinfo369487030.zip

Please let me know if it helps.

Regards
Vallarasu S.


MS Matt Speller 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.

Regards

Matt


AD Administrator Syncfusion Team 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 :)


CB Clay Burch Syncfusion Team 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.



Docking_3c9dc29d.zip


AD Administrator Syncfusion Team 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?


CB Clay Burch Syncfusion Team 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.


MS Matt Speller April 22, 2010 10:14 AM UTC

Yes - confirmed Clay - thank you very much!


LS Lingaraj S Syncfusion Team April 27, 2010 11:32 AM UTC

Hi Matt,

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

Regards,
Lingaraj S.

Loader.
Live Chat Icon For mobile
Up arrow icon