This is a migrated thread and some comments may be shown as answers.

Docking in a UserControl

3 Answers 301 Views
Dock
This is a migrated thread and some comments may be shown as answers.
tdemeza
Top achievements
Rank 1
tdemeza asked on 31 Aug 2012, 07:46 PM
So here is our scenario:

We have a main executable (app) with docking enabled.  A Left Panel and a Right panel.  Each of them can be undocked and pulled out of the application.

The left panel is a no brainer it contains windows controls, etc. 

The right panel has a few windows controls, and a user control that we created and also has docking enabled?

So there are a couple questions:

1. Is this scenario able to be accomplished? 
2. Can we build a user control that contains docking?
3. If the user control, has a docked panel(s), can we pull those out not only from the user control but also from the main application?

I hope that makes sense.  Thank you in advance for any tips, gotchas, etc. 


3 Answers, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 03 Sep 2012, 11:27 AM
Hello Tim,

Yes, it is possible to achieve the desired scenario - you can create a UserControl, place a RadDock control in it, and place the UserControl in a ToolWindow of another RadDock. Further, you can pull out ToolWindows out of the RadDock placed in the UserControl, and these ToolWindows will become separate Forms. To make sure that we are on the same page, I want to clarify that the ToolWindows will become separate forms, but they will still be a part of the application, i.e. if you close the main form of the application, the dragged ToolWindows (that have become forms) will be closed as well. This is a standard .NET behavior. Moreover, you can't dock the ToolWindows from the inner RadDock to the outer RadDock and vice versa.

I hope that this explanation helps. Let me know if you have additional questions.

Kind regards,
Nikolay
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
0
tdemeza
Top achievements
Rank 1
answered on 04 Sep 2012, 08:22 PM
Thank you for your response, however I have a couple additional questions.

1. I cannot find an easy way to add Maximize or Restore buttons to the floating window's title bar.  Is this possible?

2. If a window is docked as a tab....  Is there something special I have to do in order to be able to drag out of its container as a floating window?  It seems to lose this ability with the drag function of the mouse.  I can however make it float by right clicking. It just does not make sense that all features are not avilable to all window types. I also want to be able to restore it back to its original tabbed state as well.  This is available in VS without problems...  Just curious.  Maybe I am missing something.

3. Why can't a tool window be docked "full," only a tabbed window can be docked full.  Is there a way to overcome this as well?  Again, I don't understand the inconsistencies. 

Thank you!
0
Nikolay
Telerik team
answered on 05 Sep 2012, 12:18 PM
Hello Tim,

At the time RadDock was developed, Visual Studio 2008 was the latest official Visual Studios and RadDock follows its behavior. This is why the behavior of RadDock is as it is and why you find it as inconsistent, when comparing to VS2010. You can vote here for this task to increase its priority.

Here are the answers to your specific questions:
  1. Yes, this is possible. You need to handle the FloatingWindowCreated event and set the following properties to the FloawingWindow that is going to be shown:
    void radDock1_FloatingWindowCreated(object sender, Telerik.WinControls.UI.Docking.FloatingWindowEventArgs e)
    {
        e.Window.ShowInTaskbar = true;
        e.Window.MinimizeBox = true;
        e.Window.MaximizeBox = true;
        e.Window.FormBorderStyle = System.Windows.Forms.FormBorderStyle.Sizable;
    }
  2. The answer to your question lies in the behavior of Visual Studio 2008. At the moment, there is no way to change it. We will consider extending the behavior of RadDock to match the behavior of Visual Studio 2010.
  3. The area that holds documents is always visible by design and this is why you feel you can't dock a ToolWindow to Fill. In order to be able to do so, you should hide the document area of RadDock. Here is how to do this:
    this.radDock1.MainDocumentContainerVisible = false;

I hope this helps.

Regards,
Nikolay
the Telerik team
RadControls for WinForms Q2'12 release is now live! Check out what's new or download a free trial >>
Tags
Dock
Asked by
tdemeza
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
tdemeza
Top achievements
Rank 1
Share this question
or