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

How to set the position and width of a RadPane or SplitContainer

5 Answers 409 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Adrian
Top achievements
Rank 1
Adrian asked on 06 Dec 2011, 02:56 PM
Hi,

how do I set the width of my RadPanes in floating ToolWindow mode? I've tried to access it in various ways but had no luck so far.

Regards
Adrian

5 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 08 Dec 2011, 09:28 AM
Hi Adrian,

In order to manipulate the size of the ToolWindow, which now inherits the same base class as the RadWindow, you can use the GeneratedItemsFactory which is responsible for creating ToolWindows, SplitContainers and PaneGroups. You can create your own factory with the desired properties set to the ToolWindows, and set it to the Docking control. For a sample project please refer to this forum post.

Hope this helps.

Greetings,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Adrian
Top achievements
Rank 1
answered on 08 Dec 2011, 12:03 PM
Hello Konstantina,
thank you for your reply. Yes, it's exactly  what I've needed. Do you know how I can set the position of the floating ToolWindow inside the Docking?
I want to set the initial position with the coordinates of a drag and drop operation.

Adrian
0
Konstantina
Telerik team
answered on 12 Dec 2011, 02:54 PM
Hi Adrian,

You can use the Top and Left properties of the ToolWindow. As mentioned before, the ToolWindow inherits the same base class as the RadWindow, so pretty much everything that can be achieved with the Window, can be achieved with the ToolWindow.

Kind regards,
Konstantina
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Rakesh
Top achievements
Rank 1
answered on 19 Dec 2014, 09:38 AM
Hi Konstantina,

I have a situation, where in I am creating rad panes with MakeFloatingOnly, on a context menu item click. Is it possible to set the position of floating radpane with the X & Y offset of mousebuttondown position.

Regards,
Rakesh
0
Vladi
Telerik team
answered on 19 Dec 2014, 03:35 PM
Hello Rakesh,

When creating RadPane instances at run time you are most probably creating new wrapper RadSplitContainer instances. In such scenarios you could easily use the RadDocking.SetFloatingLocation() method in order to set a floating location for the newly created RadSplitContainer. The next code snippet shows the described approach:
in the XAML
<telerik:RadDocking x:Name="Docking">
            ...
</telerik:RadDocking>

and in the code behind:
RadPane radPane = new RadPane() { Title = "New sample RadPane" };
radPane.Content = new TextBox() { Text = "TextBox" };
RadPaneGroup radPaneGroup = new RadPaneGroup();
RadSplitContainer radSplitContainer = new RadSplitContainer();
 
// Sets starting location of the floated RadPane
RadDocking.SetFloatingLocation(radSplitContainer, new Point(400, 400));
 
// Sets starting Size of the floated RadPane
RadDocking.SetFloatingSize(radSplitContainer, new Size(200, 100));
 
radPaneGroup.Items.Add(radPane);
radSplitContainer.Items.Add(radPaneGroup);
this.Docking.Items.Add(radSplitContainer);
radPane.MakeFloatingOnly();

Hope this is helpful.

Regards,
Vladi
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Docking
Asked by
Adrian
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Adrian
Top achievements
Rank 1
Rakesh
Top achievements
Rank 1
Vladi
Telerik team
Share this question
or