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

RadPane content not displayed when Panes are added programmatically

2 Answers 91 Views
Docking
This is a migrated thread and some comments may be shown as answers.
Gabriel - Iulian
Top achievements
Rank 1
Gabriel - Iulian asked on 25 Sep 2009, 01:23 PM

Hello,

I looked on the other threads that might solve this but I couldn't find an answer.

I have a "user control", called ctrlRadPaneGroup.xaml with the content:

<telerikDocking:RadPane x:Class="telerikDocking.ctrlRadPaneGroup"  
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"   
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"   
    xmlns:telerikDocking="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Docking"  
    xmlns:dragDrop="clr-namespace:Telerik.Windows.Controls.DragDrop;assembly=Telerik.Windows.Controls"  
    xmlns:primitives="clr-namespace:Telerik.Windows.Controls.Primitives;assembly=Telerik.Windows.Controls"  
    Width="60" Height="60">  
    <telerikDocking:RadPane.Resources>  
        <DataTemplate x:Key="ApplicationDragTemplate">  
            <Image Source="{Binding IconPath}" Stretch="None" VerticalAlignment="Top" />  
        </DataTemplate>  
 
        <Style TargetType="ListBoxItem" x:Key="draggableItemStyle">  
            <Setter Property="HorizontalAlignment" Value="Stretch" />  
            <Setter Property="HorizontalContentAlignment" Value="Stretch" />  
            <Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" Value="True" />  
        </Style>  
    </telerikDocking:RadPane.Resources>  
    <telerikDocking:RadPane.Content>  
        <TextBlock>gigi</TextBlock>  
        <!--<ListBox Margin="10 10 10 10" Name="listboxInPane"  
                        dragDrop:RadDragAndDropManager.AllowDrop="True" BorderThickness="0"  
                        ItemContainerStyle="{StaticResource draggableItemStyle}"   
                        ScrollViewer.HorizontalScrollBarVisibility="Disabled" ScrollViewer.VerticalScrollBarVisibility="Disabled">  
                    <ListBox.ItemTemplate>  
                        <DataTemplate>  
                            <StackPanel VerticalAlignment="Stretch" HorizontalAlignment="Stretch">  
                                <Image Source="{Binding IconPath}" Margin="0 0 3 0"  
                                        HorizontalAlignment="Center" />  
                                <TextBlock Text="{Binding Name}" HorizontalAlignment="Center" />  
                            </StackPanel>  
                        </DataTemplate>  
                    </ListBox.ItemTemplate>  
                    <ListBox.ItemsPanel>  
                        <ItemsPanelTemplate>  
                            <primitives:RadUniformGrid Columns="3" HorizontalAlignment="Left"  
                                    VerticalAlignment="Top" />  
                        </ItemsPanelTemplate>  
                    </ListBox.ItemsPanel>  
                </ListBox>-->  
    </telerikDocking:RadPane.Content>  
</telerikDocking:RadPane>  
 

In the code behind I add another "user pane" but the content is null and the "gigi" string does not appear:

            var newPane = new ctrlRadPaneGroup();

            newPane.Header = "Pane " + numberOfPanes.ToString();  
            var groupPane = splitContainerLeft.Items[0] as Telerik.Windows.Controls.RadPaneGroup;  
            groupPane.AddItem(newPane, Telerik.Windows.Controls.Docking.DockPosition.Top); 

The pane is added successfully in the interface, but as I said "gigi", or whatever control I wanted (a listbox in my case) does not appear.

What am I doing wrong? Thank you!

2 Answers, 1 is accepted

Sort by
0
Gabriel - Iulian
Top achievements
Rank 1
answered on 25 Sep 2009, 02:04 PM

I have solved it, by making a small workaround. I have created a custom control that holds the listbox, and added the content programmaticaly after I creat the pane, but shouldn't the content of the pane be created once the custom pane was created?

            var newPane = new RadPane();  
            newPane.Header = "Pane " + numberOfPanes.ToString();  
            var newListbox = new listboxApplications();  
            newPane.Content = newListbox; 

Thanks!

0
Miroslav Nedyalkov
Telerik team
answered on 26 Sep 2009, 09:02 AM
Hi Gabriel,

I'm not fully understand what the situation is. Could you please open a support ticket and send us a sample project that demonstrates the problem? This would help us a lot.

Regards,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Docking
Asked by
Gabriel - Iulian
Top achievements
Rank 1
Answers by
Gabriel - Iulian
Top achievements
Rank 1
Miroslav Nedyalkov
Telerik team
Share this question
or