RadPane template

3 posts, 0 answers
  1. Lindsay Miles
    Lindsay Miles avatar
    75 posts
    Member since:
    Dec 2009

    Posted 06 May 2010 Link to this post

    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. Lindsay Miles
    Lindsay Miles avatar
    75 posts
    Member since:
    Dec 2009

    Posted 06 May 2010 Link to this post

    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

                {

                }

    }


  3. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 11 May 2010 Link to this post

    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.
Back to Top