In my current project I would like to ''cache'' some dockable controls at startup without making them visible.
While I have been able to use DockControl to add the control and then set the DockVisibility to false, the user can see the control being built before it becomes invisible, which is something I don''t want.
Is there a way to add a control to the DockingManager (and preferably set the dock or float state) without making it visible to the user?
I am currently extending the DockingManager and have tried some workarounds with overriding DockControl and InternalDockControl, but although I can get some of this functionality, the DockingManager becomes unstable.
Perhaps there is a more simple workaround?
ADAdministrator Syncfusion Team April 15, 2005 01:53 PM
When are you trying to create these controls? I''ve found that if the controls are docked and then hidden in either constructor or the Form Load event handler that there''s no flicker.
IYIan YatesApril 18, 2005 04:40 AM
I''m not sure we''re on the same lines here (that or I misunderstood your reply).
If I create an instance of a control to be dockable and then use DockingManager.DockControl() to dock it, the user sees the control being created and it becomes visible.
The next statement hides the control using DockingManager.SetDockVisibility()
My goal is to create an instance of the dockable control and make it part of the DockingManager''s handled controls (and preferably already docked) without it ever being visible.
Basically I''m looking for a way of calling DockControl but with the control''s DockVisibility being false and I explictly set it to true later.
ADAdministrator Syncfusion Team April 18, 2005 10:18 AM
I apologize for the confusion. By flicker, I was referring to your problem with the controls being temporarily visible.
However, I have located a better solution than moving your initialization code to the contructor or Load event handler. Please refer to the LockDockPanelsUpdate() and UnlockDockPanelsUpdate() methods in DockingManager.
IYIan YatesApril 18, 2005 12:10 PM
Thanks for your response.
This is definitely the sort of method I was looking for, but it doesn''t appear to make any real difference to the outcome.
I will try to create a sample project for you to see tomorrow so that you have a better idea of the problem and can try to think of some other solutions.
IYIan YatesApril 19, 2005 07:49 AM
I''ve added a basic example, but it is important for you to note that I haven''t been able to fully recreate the extent of the problem.
Although the basic problem is there, the controls we are using are far more complex and are generally loading large amounts of data before being used.
On running the sample you should see a maximized MDI container with two menus.
The first menu will load four controls (two visible, two hidden). This shows the first problem of the two hidden controls being briefly displayed before being made invisible. In our actual application, the effect is much greater.
While writing this, I talked a colleague through the example I''ve attached and we actually managed to correct the issue I had with point two, which swaps the view from the first two controls to the second.
I''m going to be working now on integrating these changes in to my main project to see if I can improve it; but I would appreciate you looking at the first problem.
From what I can tell, the problem is really that the DockingManager leaves the control visible while it does the work with it.
ADAdministrator Syncfusion Team April 21, 2005 03:58 PM
I apologize for the delay in getting back to you. I''ve talked with several other engineers about your problem and I have some more information to share with you.
First, I''ve talked with the Tech Support Engineer in charge of Docking. He''s aware of some limitations with LockWindowsUpdate and is working on improving it.
Second, I''ve come up with a partial workaround. As far as I can tell, LockWindowsUpdate works correctly if you only intialize a single control with it. So if you can either avoid initalizing more than one control at a time or space out the initialization of multiple controls with a Timer, you should be able to avoid the flashing. Due to the load time of the Grids, this shouldn''t cause to much disruption to your application.
Finally, I talked to a Grid engineer to make sure that this isn''t a Grid problem (which it isn''t). I don''t know if the algorithm you''re using to populate the Grid in the sample is the same as the one you''re using in your application, but, if it is, he suggested a few optimizations. You might want to make a post on the Grid Forum and ask about them.
My only other thought is that you could create the controls and keep them hidden and undocked. You would then keep them undocked until you''re ready to show them.
Thank you for your patience and your interest in Syncfusion products.