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.
Syncfusion Feedback

adding controls to docking manager - at runtime

Thread ID:

Created:

Updated:

Platform:

Replies:

96213 Aug 27,2010 07:47 PM UTC Aug 30,2010 11:11 AM UTC Windows Forms 2
loading
Tags: Tools
Jakub
Asked On August 27, 2010 07:47 PM UTC

Hello,

I need to add controls to form at runtime. I'm using DockingManager to arrange them. Controls are stored in List.

To add controls to form I tried to use following code:

foreach (Control control in controlList)
{
this.Controls.Add(control);
dockingManager.DockControl(
control,
control.Parent,
(DockingStyle)controlsDocking[control.Name],
control.Width);
}

The controlList is collection with Controls and dockingManager is instance of DockingManager. controlsDocking is Dictionary where key is name of Control and value DockingStyle property.

The line where I add control to dockingManager throws an ArgumentOutOfRangeException.

this is how a panel is added to collection:

panel1.Width = 200;
panel1.Parent = this;
panel1.Name = "panel1";

controlsDocking.Add(panel1.Name,DockingStyle.Left);
controlList.Add(panel1);

I tried to write those arguments in MessageBox to be sure what it returns and everything was fine, so I don't know where the problem is.
I would be glad for any help so as I could add controls to docking manager at runtime.

Thanks in advance,
J.

Jakub
Replied On August 30, 2010 08:21 AM UTC

Ok, so it's working now. I guess I just missed something..

Lingaraj S [Syncfusion]
Replied On August 30, 2010 11:11 AM UTC

Hi Jakub,

We are glad to hear that you has been solved.

Thank you for using Syncfusion products and 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.

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

;