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

Docking Manager UserControl problem

The DockControl function does not appear to work correctly when the DockingManager.Host is set to a UserControl. The controls do not appear. It works fine when the host control is the main form, though. Also, SetEnableDocking works on the UserControl controls, but then you cannot position and size them programmatically. Am I doing something wrong, or is this a bug? I have attached a test solution that illustrates my dilemma. Any assistance would be most welcome! Test_9805.zip

7 Replies

AD Administrator Syncfusion Team August 10, 2004 03:51 PM UTC

Hi Tracy, Thanks for the sample attached. I have reviewed it and these are my observations : 1. A form can host only one instance of the DockingManager. Having more than one DockingManager (dockingManager1 and dockingManager3) on a form could lead unpredictable behavior and hence is not advisable. 2. The Panels panel1, panel2, panel3, and panel4 are all created outside the designer generated code. But they are not assigned to the Controls collection of the form. What is hosting these panels? 3. Please refer to the ContainerControl demo sample in the directory ...\Syncfusion\Essential Suite\2.0.5.1\Tools\Samples\Docking Package\ContainerControlSupportDemo\UserControlContainerControlDemo. This illustrates the use of DockingManager within a UserControl. If this does not meet your requirements, please do let us know in detail about what you wish to accomplish and we can then send you an appropriate sample application. We appreciate your cooperation, and thanks for choosing Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


TR Tracy August 10, 2004 07:02 PM UTC

Thank you for your prompt reply! In regards to your last message: 1. The multiple instances were used to show that even when a new docking manager was created on the form, DockControl works - just not on a user control. 2. The panels are not hosted until they are docked. As you can see, they work perfectly in all cases except DockControl on the user control - even SetEnableDocking on the user control works fine. 3. The sample solution creates user controls with controls assigned to the docking manager at design-time - this is not possible for us. We need to create controls at runtime and add them to the docking manager. Our code creates a user control for each of several items that can be selected - each one then has its own area to create controls that will be managed by its own instance of the docking manager. The code works exactly as we want it to - each area can be switched to and persisted and restored - with the exception of the very FIRST time, when no persistance data exists. In that case, I was hoping to be able to use the DockControl function to place the controls in a default layout, but it does not work - the controls do not appear. If I use SetEnableDocking, however, they do appear, but I cannot control the placement programatically. We can work around this by running our application in VS, arranging the controls visually, persisting the layout to a file and including it as part of the install, but we were hoping to be able to avoid this and to have more control by programatically placing the controls when it is first run by the user. I have tried many different was to get this to work, and the main problem appears to be that controls created at runtime cannot be associated with the a user-control docking manager except by using SetEnableDocking. We are using the tool in a little different manner than designed, but it has worked very well, with this one exception. Thank you for attention in this matter!


AD Administrator Syncfusion Team August 12, 2004 09:05 PM UTC

Hi Tracy, Thanks for the detailed update. 2. I do see that the controls do get docked when even if they do not belong the host form''s or UserControl''s Controls collection. But it is a good practice to add controls to a host form/UserControl''s collection as soon as they are created. 3. Please refer to the following lines of your earlier update : " I was hoping to be able to use the DockControl function to place the controls in a default layout, but it does not work - the controls do not appear. If I use SetEnableDocking, however, they do appear, but I cannot control the placement programatically." According to my understanding you are referring to the situation when the ''Dock on UserControl'' button is pressed. This is because the the docking window layout created when the ''Dock on Form'' button is pressed looks exactly the same as the one created when ''Dock on UserControl''is pressed. I have modified your code to show that the controls do get docked on the UserControl when DockControl is used. Please refer to the modified sample attached here and let me know if you have any suggestions in this regard. Also refer to the new test sample attached here. Here I add UserControls dynamically at runtime to the host form. The host form hosts an instance of DockingManager in it, and a docking layout can be created using the UserControls on it. The UserControl itself hosts a DockingManager and other controls and has its own docking layout. So it is a nested docking layout kind of scenario. I can successfully save/load dock state information of each UserControl individually as well as the host form (which includes all the UserControls on it). Note that only the DockControl method is used everywhere (both on the form and the UserControl) and it works fine. Please refer to the sample and let me know if you need further assistance. We appreciate your interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


TR Tracy August 12, 2004 10:35 PM UTC

Thanks again for looking at this Guru! I believe what is happening here is that this is working on your system, but not on mine. I downloaded both samples and tried them. The modified sample (you changed the docking location of a couple of controls) is the same as before - none of the controls appear at all. In the second example, when I add a userControl1, the docking window appears, but there are no panels inside of it. I did notice that the second project had to be converted to load in my version of VS.Net - I am running VS.Net 7.1.3088 (Framework 1.1.4322) on Windows XP Professional. I am sending a couple of screenshots so you can see exactly what I am seeing. Thanks again for your efforts on this! Screenshots_3172.zip


AD Administrator Syncfusion Team August 13, 2004 12:50 AM UTC

Hi Tracy, Thanks for the screenshots. One possible reason for this discrepancy could be that you are using an older version of Essential Suite than the one that I am using. Please create an incident in Direct-Trac about this, and I will update you with more information there. We appreciate your cooperation, and thanks for your continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.


TR Tracy August 13, 2004 01:18 PM UTC

I have both 1.6.1.0 and 2.0.5.1 installed, and I have used the Assembly Manager to make 2.0.5.1 active. I will open a Direct-Trac session now. Thank you!


AD Administrator Syncfusion Team August 13, 2004 01:51 PM UTC

Hi Tracy, Thanks for the update, and also for creating Direct-Trac incident 12984 in this regard. I will update you there shortly. We appreciate your cooperation, and continued interest in Syncfusion products. Regards, Guru Patwal Syncfusion, Inc.

Loader.
Live Chat Icon For mobile
Up arrow icon