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.
Unfortunately, activation email could not send to your email. Please try again.

DockingManager Control Order

Thread ID:

Created:

Updated:

Platform:

Replies:

93739 Mar 31,2010 05:43 AM Apr 27,2010 07:32 AM Windows Forms 10
loading
Tags: Tools
Matt Speller
Asked On March 31, 2010 05:43 AM

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

Vallarasu S [Syncfusion]
Replied On April 6, 2010 11:54 AM

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

Matt Speller
Replied On April 12, 2010 08:35 AM

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

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

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.

Matt Speller
Replied On April 15, 2010 04:46 AM

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

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

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 07:48 AM

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

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

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 12:09 PM

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 06:14 AM

Yes - confirmed Clay - thank you very much!

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

Hi Matt,

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

Regards,
Lingaraj S.

CONFIRMATION

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.

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.

;