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

RadPane template

2 Answers 110 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Lindsay Miles
Top achievements
Rank 1
Lindsay Miles asked on 06 May 2010, 01:33 PM
Is it possible to build a template of a RadPane with constituent controls and ADD said pane to a RadPaneGroup each time the user selects to add a new RadPane?

In this way there might be 1 to 6 instances of the RadPane, each will display different content BUT all Panes and all controls are identical, derived from one template.

Can someone explain?

Thanks


2 Answers, 1 is accepted

Sort by
0
Lindsay Miles
Top achievements
Rank 1
answered on 06 May 2010, 04:35 PM
New Approach.

Built a Template, assigned it to a Style then tried adding a new RadDocumentPane with the Style to the RadPaneGroup.

No controls show in the panes. The panes display as needed, ie: docked and tabbed at the top.
But as one clicks each pane (see I add 3 or 4), none of the panes show any of the controls from the Template/Style.

Code and markup below with the xaml and method to add a pane.
I've tried using a RadPane and a RadDocumentPane to no avail.
If the Grid is commented IN or OUT, no difference.
Combobox items removed for clarity

ANY HELP PLEASE!!!

        <ControlTemplate x:Key="RadPaneTemplate" TargetType="telerikDocking:RadDocumentPane">

            

            <!--Grid Width="600" Height="600" Background="Cyan" -->

                <StackPanel Width="600" Height="600" Orientation="Vertical">

                    <Canvas Height="300" Width="600" MouseLeftButtonDown="canvas1_MouseLeftButtonDown"MouseLeftButtonUp="canvas1_MouseLeftButtonUp" MouseMove="canvas1_MouseMove" Margin="0,0,0,0">

                        <Image Margin="0,0,0,0"Source="/MyApp;component/Images/pngs/test.png"></Image>

                    </Canvas>

                    <Canvas Height="300" Width="600">

                        <StackPanel Height="300" Width="600" Orientation="Vertical" >

                            <StackPanel Height="25" Width="597" Orientation="Horizontal"Margin="4,0,0,0" HorizontalAlignment="Left">

                                <StackPanel Orientation="Horizontal" Width="175"HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,3,0,0">

                                    <dataInput:Label Content="Dgrm Type:" Height="25"Width="70"></dataInput:Label>

                                    <ComboBox Width="100"></ComboBox>

                                </StackPanel>

                                <StackPanel Orientation="Horizontal" Width="220"HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,3,0,0">

                                    <dataInput:Label Content="Dgrm Focus:" Height="25"Width="70"></dataInput:Label>

                                    <ComboBox Width="138"></ComboBox>

                                </StackPanel>

                                <StackPanel Orientation="Horizontal" Width="200"HorizontalAlignment="Left" VerticalAlignment="Stretch" Margin="0,3,0,0">

                                    <dataInput:Label Content="Sequence:" Height="25" Width="115" ></dataInput:Label>

                                    <ComboBox Width="85"></ComboBox>

                                </StackPanel>

                            </StackPanel>

                            <StackPanel Height="25" Width="370" Orientation="Horizontal"Margin="4,3,0,0" HorizontalAlignment="Left">

                                <dataInput:Label Content="Dgrm Title:" Height="25" Width="70"HorizontalAlignment="Left"></dataInput:Label>

                                <TextBox Width="295" HorizontalAlignment="Left"></TextBox>

                            </StackPanel>

                            <StackPanel Orientation="Horizontal" Width="600" Height="240">

                                <StackPanel Height="235" Width="297" Orientation="Vertical">

                                    <dataInput:Label Content="Dgrm Notes:" Height="25"Margin="4,0,0,0"></dataInput:Label>

                                    <TextBox Height="200" Margin="4,0,0,0" AcceptsReturn="True"VerticalScrollBarVisibility="Auto"></TextBox>

                                </StackPanel>

                                <StackPanel Height="235" Width="297" Orientation="Vertical">

                                    <dataInput:Label Content="Dgrm Description:" Height="25"Margin="4,0,0,0"></dataInput:Label>

                                    <TextBox Height="200" Margin="4,0,0,0" AcceptsReturn="True"VerticalScrollBarVisibility="Auto"></TextBox>

                                </StackPanel>

                            </StackPanel>

                        </StackPanel>

                    </Canvas>

                </StackPanel>

            <!-- /Grid -->

        </ControlTemplate>

        <Style x:Key="RadPaneStyle" TargetType="telerikDocking:RadDocumentPane">

            <Setter Property="Template" Value="{StaticResource RadPaneTemplate}"></Setter>

        </Style>

        private void BuildNewPane(int iPaneNum)

        {

//iPaneNum is the current pane count on the RadPaneGroup

            RadDocumentPane rp = new RadDocumentPane();

            //rp.Name = "rpDgrm" + (iPaneNum - 1);

            rp.CanUserPin = false;

            rp.CanUserClose = false;

            rp.CanFloat = false;

            rp.IsPinned = true;

            rp.Header = "Diagram" + (iPaneNum - 1);

            try

            {

                //rp.Template = (ControlTemplate)this.Resources["RadPaneTemplate"];

                rp.Style = (Style)this.Resources["RadPaneStyle"];

                rp.UpdateLayout();

                rpgDiagrams.Items.Add(rp);

                rpgDiagrams.UpdateLayout();

            }

            catch

            {

            }

}


0
Miroslav Nedyalkov
Telerik team
answered on 11 May 2010, 09:55 AM
Hello Lindsay,

 I answered to the other thread you posted: http://www.telerik.com/community/forums/silverlight/docking/307159-error-adding-controls-to-new-radpane.aspx.

Greetings,
Miroslav Nedyalkov
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
Lindsay Miles
Top achievements
Rank 1
Answers by
Lindsay Miles
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or