RadPaneGroup initialPosition and initialSize

2 posts, 0 answers
  1. Chao
    Chao avatar
    1 posts
    Member since:
    Oct 2013

    Posted 10 Apr 2014 Link to this post

    I want to change the position and size of a RadPaneGroup programatically based on user actions. I tried setting the initialPosition but that doesn't seem to work. I also tried RadPane.removeFromParent() and RadPaneGroup.Items.Add() and then set the initialPosition but no luck.
  2. Kalin
    Admin
    Kalin avatar
    1207 posts

    Posted 14 Apr 2014 Link to this post

    Hi Chao,

    I've noticed you have opened a support ticket with the same question but for Silverlight. However the approach we have provided you there could be used for WPF as well. I'm copying our answer here in order to be available to the community:

    In order to dock a specific RadPane instance using the code behind you could do the following:
    • Create a new RadPaneGroup
    • Use the RemoveFromParent method on the RadPane which is being docked
    • Create a new RadSplitContainer and set its InitialPosition to the desired DockState value
    • Add the RadPane that is being docked to the Items of the RadPaneGroup
    • Add the RadPaneGroup to the new RadSplitContainer
    • Finally add the RadSplitContainer to the RadDocking Items.

    I'm also attaching a sample project for WPF which demonstrates the same approach, note that the example also demonstrates how to set the size of the SplitContainer when creating it (as you have also asked about that in the ticket).

    Hope this will work for you.

    Regards,
    Kalin
    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.

     
  3. DevCraft banner
Back to Top