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

Setting ToolWindow Size and Location

3 Answers 314 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Bill
Top achievements
Rank 1
Bill asked on 09 Sep 2010, 02:48 PM
I'm using Q1 2010 SP2 and having trouble resizing and positioning a ToolWindow after it has already been created.  Here's some code I've tried:

 

 

 

 

toolWindow.Size = new Size(400, 300);
toolWindow.Top = Location.Y;
toolWindow.Left = Location.X;
toolWindow.DockState = Telerik.WinControls.UI.Docking.DockState.Floating;

 

 


Also tried these...

 

//toolWindow.TabStrip.SizeInfo.SizeMode = SplitPanelSizeMode.Absolute;
//toolWindow.TabStrip.SizeInfo.AbsoluteSize = new Size(150, 0); 
  
and 
  
//if (toolWindow.DockingSite.HostFrom != null)
//{
// toolWindow.DockingSite.HostForm.Size = new Size(300, 300);
//} 

 

 

 

But none of these appeared to work...ideas?  Thx...

3 Answers, 1 is accepted

Sort by
0
Bill
Top achievements
Rank 1
answered on 09 Sep 2010, 03:26 PM
Argh!  Nevermind...looks like this one line of code does the trick...
toolWindow.Float(Location, WinSize);
0
Bill
Top achievements
Rank 1
answered on 09 Sep 2010, 07:59 PM
Sorry if I continue to ask dumb questions here but we are hurting for some documentation. Unfortunately your documentation deals with creating windows and not with how to change the state of windows that already exist

For example, I'd like to use the DockTo method to presumably to change a DocumentPosition of a ToolWindow.  But I'm not able to find a reference to the window object needed as the first parameter of DockTo(). I only have one toolWindow (so I cannot dock to some other window as in your examples) but it already exists as a floating window.  How do I dock it!

I see the GetDefaultDocumentTabStrip() method of RadDock. It's one line description might indicate that it could be used but can you provide and example?   If I have an application that has two modes - lets say advanced and basic - we may want different tool and document layouts based on which mode is chosen.  However we don't want to write code to save and restore all the content (which would be needed if we did a SaveLayoutToXml). In this example our content remains.  So, could you provide examples for restoring the state of windows that already exist?

We appreciate any assistance you can provide. I know, as above, there must be some simple answers I'm overlooking...
0
Nikolay
Telerik team
answered on 17 Sep 2010, 06:22 PM
Hi Bill,

Thank you for the question.

You can get a DockWindow by its name as shown below:
toolWindow1.DockTo(this.radDock1["toolWindow2"], Telerik.WinControls.UI.Docking.DockPosition.Fill);

You can also get a DockWindow by using one of the following collections (depending whether you want to get a DocumentWindow or a ToolWindow):
this.radDock1.DockWindows.DocumentWindows 
this.radDock1.DockWindows.ToolWindows

The GetDefaultDocumentTabStrip() method gets the ActiveWindow of the DocumentManager and then returns its DocumentTabStrip. If no ActiveWindow is found, this method returns the first DocumentTabStrip found in RadDock. If there are no DocumentTabStrips in RadDock, and the parameter of the method is true, a new DocumentTabStrip is added to RadDock.

You can find the answer of your question concerning the DockState of an AutoHide window in this forum thread.

If there are any specific questions which come up during the process of implementing custom save/load layout functionality, feel free to contact us.

Kind regards,
Nikolay
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Dock
Asked by
Bill
Top achievements
Rank 1
Answers by
Bill
Top achievements
Rank 1
Nikolay
Telerik team
Share this question
or