How to add RadPane in DocumentHost dynamically

5 posts, 0 answers
  1. Syam
    Syam avatar
    13 posts
    Member since:
    Aug 2011

    Posted 23 Sep 2011 Link to this post

    Hi,

    I have a requirement to add a RadPane in DocumentHost on the click of a button. My markup for Docking control is as follows

     <DataTemplate x:Key="ContentTemplate">
                <ContentControl regions:RegionManager.RegionName="TabRegion"></ContentControl>
      </DataTemplate>
    <telerik:RadDocking  x:Name="radDocking1" BorderThickness="0"  Padding="0">
                <telerik:RadDocking.DocumentHost>
                    <telerik:RadSplitContainer>
                        <telerik:RadPaneGroup
                           x:Name="DockContent"
                           ContentTemplate="{StaticResource ContentTemplate}">
                        </telerik:RadPaneGroup>
                    </telerik:RadSplitContainer>
                </telerik:RadDocking.DocumentHost>
            </telerik:RadDocking>

    I need to have same layout in each pane of the document host, hence I am binding the content to a template where I have a Prism region. Initially i want one RadPane to be there and on click of button, the panes add up with the same content template. I am going with RadDocking here is because my basic requirement is to have side by side view of two documents as in Visual Studio 2010.

    Also I would want the RadPane to have the capability to minimize and maximize.

     I am using Prism 4 with Silverlight 4.

    Any help is appreciated. 

    Thanks in advance
    Syam 

  2. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 27 Sep 2011 Link to this post

    Hi Syam,

    Please review the attached project in which is illustrated how to implement Prism with RadDocking control and let us know if you have further questions.

    Best wishes,
    Konstantina
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
  3. DevCraft banner
  4. Syam
    Syam avatar
    13 posts
    Member since:
    Aug 2011

    Posted 28 Sep 2011 Link to this post

    Hi Konstantina,

    Thanks for your reply. I will try this out and let you know.

    Syam
  5. Syam
    Syam avatar
    13 posts
    Member since:
    Aug 2011

    Posted 28 Sep 2011 Link to this post

    Hi Konstantina,

    I went through your sample. My requirement is that the number of DocumentPanes should be dynamic. Initially one Pane only would be there and on a button click (say 'AddPane'), the Pane should get appended. This is similar to approach followed by Visual Studio 2010 wherein when you open a .cs file, one DocumentPane is loaded in DocumentHost and when i click another .cs file, that stacks up along with the previous DocumentPane like a tab item. Also is it possible to have a minimize and maximize functionality to those DocumentPanes.

    Thanks
    Syam 
  6. George
    Admin
    George avatar
    1332 posts

    Posted 04 Oct 2011 Link to this post

    Hello Syam,


    I modified the sample in order to add a panes on a button click. You can find the project attached as well. In order to dynamically add a panes to the document host, all you need is to call the IRegionManager.AddToRegion method and specify a region and a view. Please, note that there is a bug in the document host and the GroupPane placed inside is not recognized as a region. You could workaround this problem defining the region manually in the Shell c'tor: documentHost.SetValue(RegionManager.RegionManagerProperty, regionManager);

    Hope this helps.


    Regards,
    George
    the Telerik team
    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
Back to Top
DevCraft banner