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

6 posts, 0 answers
  1. Adrian
    Adrian avatar
    16 posts
    Member since:
    Jun 2010

    Posted 06 Dec 2011 Link to this post

    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
  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 08 Dec 2011 Link to this post

    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 >>
  3. DevCraft banner
  4. Adrian
    Adrian avatar
    16 posts
    Member since:
    Jun 2010

    Posted 08 Dec 2011 Link to this post

    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
  5. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 12 Dec 2011 Link to this post

    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 >>
  6. Rakesh
    Rakesh avatar
    7 posts
    Member since:
    Oct 2014

    Posted 19 Dec 2014 Link to this post

    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
  7. Vladi
    Admin
    Vladi avatar
    744 posts

    Posted 19 Dec 2014 Link to this post

    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.

     
Back to Top
DevCraft banner