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

How to add RadPane in DocumentHost dynamically

4 Answers 303 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Syam
Top achievements
Rank 1
Syam asked on 23 Sep 2011, 11:37 AM
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 

4 Answers, 1 is accepted

Sort by
0
Konstantina
Telerik team
answered on 27 Sep 2011, 02:50 PM
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 >>
0
Syam
Top achievements
Rank 1
answered on 28 Sep 2011, 05:21 AM
Hi Konstantina,

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

Syam
0
Syam
Top achievements
Rank 1
answered on 29 Sep 2011, 03:46 AM
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 
0
George
Telerik team
answered on 04 Oct 2011, 09:38 AM
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 >>
Tags
Docking
Asked by
Syam
Top achievements
Rank 1
Answers by
Konstantina
Telerik team
Syam
Top achievements
Rank 1
George
Telerik team
Share this question
or