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

want to add usercontrol in raddocumetpane

2 Answers 78 Views
Docking
This is a migrated thread and some comments may be shown as answers.
karamjeet
Top achievements
Rank 1
karamjeet asked on 16 May 2011, 01:51 PM
i want to add usercontrol in raddocumentpane dynamically through code at runtime is this possible

<telerik:RadPaneGroup Name="radPaneGroup">
 
<telerik:RadDocumentPane x:Name="df" Header="ddf">
                             
                            <add User Control>
                        </telerik:RadDocumentPane>
             </telerik:RadPaneGroup>
how to add this from code behind however i put post this question on http://forums.silverlight.net/forums/t/228962.aspx they send me to this site In between i tried it by own and come with my findings i added silverlight templated control to my project add some design in that and call it on my MainPage.xaml
radPaneGroup.Items.Add(new testing { Header= "dfhdfjh"});
testing is the templated control class which is inheriting from RadDocumentPane radPaneGroup is RadPaneGroup in which i am adding RadDocumentPane The problem is that when i run the code it add the testing class in the header of RadDocumentPane This is Generic.xaml in which i am specifying the controls
<Style TargetType="local:testing">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:testing">
                    <StackPanel x:Name="RottElement">
                        <TextBox x:Name="sjhd" IsReadOnly="True"></TextBox>
                        <TextBox x:Name="hello"></TextBox>
                        <Button Content="testring"></Button>
                    </StackPanel>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
hope, you understand what is going on and come up with your findings

2 Answers, 1 is accepted

Sort by
0
karamjeet
Top achievements
Rank 1
answered on 17 May 2011, 04:51 AM
Any Help,
I want this urgently.
0
Konstantina
Telerik team
answered on 18 May 2011, 11:09 AM
Hi Karamjeet,

Where do you want to add the UserControl? In the DocumentPane or in its Header? If you want to add it in the DocumentPane, all you need to do is to assign x:Name to the Pane and then set its Content property to the UserControl you have declared. For more information you can refer to this help article.

Hope this information helps.

Regards,
Konstantina
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Docking
Asked by
karamjeet
Top achievements
Rank 1
Answers by
karamjeet
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or