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

How do I programmatically make a RadPane float on creation?

3 Answers 347 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Robert
Top achievements
Rank 1
Robert asked on 11 Nov 2010, 03:38 PM
I'm trying to do this:

// Create new pane.
_dockPane = new RadPane { Content = viewModel, Title = title };
_dockPane.IsFloating = true;

However, IsFloating is a read-only property.
So how do I create a pane that is floating on creation and how would I programmatically set the size of the floating window?
 
Does the user have to physically float the window themselves?

3 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 12 Nov 2010, 10:12 AM
Hello Robert,

Thank you for the code snippet.

To make initially the Pane floating, first you will have to add the new Pane to a PaneGroup. After that you can set the MakeFloatingDockable method of the Pane, to make it floating, but dockable.

Hope this information helps. If you have further questions please let us know.

Greetings,
Konstantina
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
0
Adam
Top achievements
Rank 1
answered on 21 Jan 2011, 05:49 PM
Howdy,

I am trying add a pane programmaticly to document host that is floating and only floating.  I am calling MakeFloatingOnly(), but the pane always appears docked initially
Telerik.Windows.Controls.RadSplitContainer oContainer = new  Telerik.Windows.Controls.RadSplitContainer();
 
            oContainer.InitialPosition = Telerik.Windows.Controls.Docking.DockState.FloatingOnly;
 
            DockingContainer.Items.Add(oContainer);
 
            RadPaneGroup oRadPaneGroup = new RadPaneGroup();
 
             
 
            RadPane oPane = new RadPane();
 
            oContainer.Items.Add(oRadPaneGroup);
 
            oRadPaneGroup.Items.Add(oPane);
 
            bool bValue = oPane.IsDockable;
 
            //oPane.CanFloat=true;
 
             
 
            //oPane.CanUserPin=false;
 
            oPane.CanDockInDocumentHost = false;
 
             
 
             
 
            oPane.MakeFloatingOnly();
 
 
 
            oContainer.Focus();
 
            oRadPaneGroup.Focus();
 
            oPane.Focus();
 
 
            RadDocking.SetFloatingLocation(oContainer, new Point(100, 100));
 
            RadDocking.SetFloatingSize(oContainer, new Size(200, 200));
 
            oPane.MakeFloatingOnly();
Is there a way to make it so that the window starts out floating?  I have tried setting MakeFloatingOnly() twice but to no avail.

Thanks,

Adam
0
Konstantina
Telerik team
answered on 26 Jan 2011, 02:25 PM
Hi Robert,

Thank you for the code snippet.

Note that MakeFloatingOnly(), MakeFloatingDockable() and MakeDockable() methods work only when all objects are constructed and added to the object tree. Which means that you should invoke them after the Loaded event of the RadDocking control has been fired. You can find more information in this help article: http://www.telerik.com/help/wpf/raddocking-features-panes-docked-floating-panes.html
So, to make it work, you can make the pane floating in the Loaded event of the Docking control.

Hope this information helps. Please let us know if you have any other questions.

All the best,
Konstantina
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
Docking
Asked by
Robert
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Adam
Top achievements
Rank 1
Share this question
or