Dynamically Create Floating Pane

3 posts, 0 answers
  1. Ernesto Morin
    Ernesto Morin avatar
    4 posts
    Member since:
    May 2010

    Posted 10 Dec 2010 Link to this post

    I have defined a Container and a Group in XAML code.

                <telerik:RadSplitContainer x:Name="FloatingContainer" InitialPosition="FloatingDockable"
                        telerik:RadDocking.FloatingLocation="250, 50"
                        telerik:RadDocking.FloatingSize="300, 220">
                    <telerik:RadPaneGroup x:Name="FloatingContainerGroup">

    I am trying to create a RadPane through code to add it to the group at runtime. 


    My problem is that everything works fine except that I never see the FloatingPane pop up.  It works fine if I create a RadPane in XAML and then add the dynamically created new radpane.

    What am I missing?
  2. George
    George avatar
    1332 posts

    Posted 11 Dec 2010 Link to this post

    Hi Ernesto,

    In order to add a RadPane dynamically and make it floating, I would suggest you to use RadPane.MakeFloatingDockable() method. If you want to use already empty defined RadPaneGroup and add the new RadPanes to this group, please refer to the code below:

    <telerik:RadSplitContainer x:Name="FloatingContainer"
                        telerik:RadDocking.FloatingLocation="250, 50"
                        telerik:RadDocking.FloatingSize="300, 220">
                    <telerik:RadPaneGroup x:Name="FloatingContainerGroup">

    and in the code behind:

    var pane = new RadPane { Header = "pane 1" };

    But, if you want to create many floating RadPanes dynamically, it is a better aproach to define the RadSplitContainers and the RadPaneGroups in the code behind as well:

    // create a new RadSplitContainer and add it to the RadDocking
                RadSplitContainer container = new RadSplitContainer();
                RadDocking.SetFloatingLocation(container, new Point(250, 50));
                RadDocking.SetFloatingSize(container, new Size(300, 220));
                // create a new RadPaneGroup and place it in the RadSplitContainer
                RadPaneGroup group = new RadPaneGroup();
                // create a new RadPane, place it in the RadPaneGroup and make it FloatingDockable
                var pane = new RadPane { Header = "pane 1" };

    For more information about RadPanes, please refer to our online documentation - http://www.telerik.com/help/silverlight/raddocking-panes-radpane.html

    I hope this helps.

    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Dean Wyant
    Dean Wyant avatar
    46 posts
    Member since:
    Nov 2009

    Posted 08 Feb 2011 Link to this post

    An alternative that works for me is:

    RadSplitContainer SC = new RadSplitContainer() { InitialPosition = Telerik.Windows.Controls.Docking.DockState.FloatingDockable };
    RadPaneGroup PG = new RadPaneGroup();
     Pane = new RadPane();
     Pane.Content = ?;
Back to Top