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

The property content is set more than once

1 Answer 880 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
geekchick
Top achievements
Rank 1
geekchick asked on 02 Nov 2009, 09:59 PM

Hi,

First off, the Telerik tools are really great! I'm trying to embed multiple controls inside of the expander tool. For example, I have one main expander with a tab control and tab item inside. Inside of these I want to have multiple panel controls and inside the panel controls I wish to have other controls, like a listbox, form, treeview, etc. Right now I am getting an error of The property content is set more than once when I add my ListBox control. I'm assuming I need to wrap my controls in another control like a grid or canvas? Any thoughts? Thanks in advanced.

<!-- Main Grid-->

 

 

<Grid x:Name="LayoutRoot">

 

 

 

<Grid.ColumnDefinitions>

 

 

 

<ColumnDefinition/>

 

 

 

<ColumnDefinition/>

 

 

 

<ColumnDefinition/>

 

 

 

</Grid.ColumnDefinitions>

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

</Grid.RowDefinitions>

 

 

 

<!-- Main Expander containing the Tab Control-->

 

 

 

<telerik:RadExpander ExpandDirection="Down" Grid.ColumnSpan="3" Grid.RowSpan="4">

 

 

 

<!-- Tab Control-->

 

 

 

<telerikNavigation:RadTabControl>

 

 

 

<!-- Tab Items-->

 

 

 

<telerikNavigation:RadTabItem Header="Browse Results"></telerikNavigation:RadTabItem>

 

 

 

<telerikNavigation:RadTabItem Header="Analyze Clip">

 

 

 

 

<!--Panel Bar-->

 

 

 

<telerikNavigation:RadPanelBar Width="450" Height="250" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top" >

 

 

 

<!--Panel Item-->

 

 

 

<telerikNavigation:RadPanelBarItem IsExpanded="True" Width="400" Height="200" Grid.Column="1" Grid.Row="0" VerticalAlignment="Top">

 

 

 

<!-- Grid for the Form Wizard-->

 

 

 

<Grid Height="200" Width="400">

 

 

 

<Grid.ColumnDefinitions>

 

 

 

<ColumnDefinition Width="0.75*"/>

 

 

 

<ColumnDefinition Width="1.5*"/>

 

 

 

<ColumnDefinition Width="0.75*"/>

 

 

 

<ColumnDefinition Width="1.5*"/>

 

 

 

</Grid.ColumnDefinitions>

 

 

 

<Grid.RowDefinitions>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

<RowDefinition/>

 

 

 

</Grid.RowDefinitions>

 

 

 

<Rectangle Grid.RowSpan="4" Grid.ColumnSpan="4" Fill="White" RadiusX="2"

 

 

RadiusY="2"></Rectangle>

 

 

 

<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Outlet" Grid.Column="0" Grid.Row="0"></TextBlock>

 

 

 

<TextBox Grid.Column="1" Margin="5" Height="25"></TextBox>

 

 

 

<TextBlock Grid.Column="0" Grid.Row="1" HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Medium"></TextBlock>

 

 

 

<telerikInput:RadComboBox Grid.Column="1" Grid.Row="1" Height="25">

 

 

 

<telerikInput:RadComboBoxItem Content="Print-Newspaper"></telerikInput:RadComboBoxItem>

 

 

 

</telerikInput:RadComboBox>

 

 

 

<TextBlock Grid.Column="0" Grid.Row="2" HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Title"></TextBlock>

 

 

 

<TextBox Grid.Row="2" Grid.Column="1" Margin="5" Height="25"></TextBox>

 

 

 

<TextBlock Grid.Column="0" Grid.Row="3" HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Byline"></TextBlock>

 

 

 

<TextBlock Grid.Row="3" Height="25" Text="John Doe" Grid.Column="1" Margin="5"></TextBlock>

 

 

 

<HyperlinkButton x:Name="StartButton" Content="Add" Grid.Column="2" Grid.Row="3" Click="StartButton_Click"></HyperlinkButton>

 

 

 

<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Status" Grid.Column="2" Grid.Row="0"></TextBlock>

 

 

 

<telerikInput:RadComboBox Grid.Column="3" Grid.Row="0" Height="25">

 

 

 

<telerikInput:RadComboBoxItem Content="Analyzed"></telerikInput:RadComboBoxItem>

 

 

 

</telerikInput:RadComboBox>

 

 

 

<TextBlock Grid.Row="1" Height="25" Text="Pub Date" Grid.Column="2" Margin="5"></TextBlock>

 

 

 

<telerikInput:RadMaskedTextBox Height="25" Mask="##/##/####" Grid.Column="3" Grid.Row="1"></telerikInput:RadMaskedTextBox>

 

 

 

<TextBlock HorizontalAlignment="Right" VerticalAlignment="Center"

 

 

Text="Source" Grid.Column="2" Grid.Row="2"></TextBlock>

 

 

 

</Grid>

 

 

 

<telerikInput:RadComboBox Grid.Column="3" Grid.Row="2" Height="25">

 

 

 

<telerikInput:RadComboBoxItem Content="Factavia"></telerikInput:RadComboBoxItem>

 

 

 

</telerikInput:RadComboBox>

 

 

 

</telerikNavigation:RadPanelBarItem>

 

 

 

</telerikNavigation:RadPanelBar>

 

 

 

 

<!-- List Box for Tracked Topics-->

 

 

 

<toolkit:ListBoxDragDropTarget mswindows:DragDrop.AllowDrop="True" >

 

 

 

<ListBox x:Name="listBox1" Width="250">

 

 

 

<ListBox.ItemsPanel>

 

 

 

<ItemsPanelTemplate>

 

 

 

<StackPanel/>

 

 

 

</ItemsPanelTemplate>

 

 

 

</ListBox.ItemsPanel>

 

 

 

</ListBox>

 

 

 

</toolkit:ListBoxDragDropTarget>

 

 

 

</telerikNavigation:RadTabItem>

 

 

 

</telerikNavigation:RadTabControl>

 

 

 

</telerik:RadExpander>

 

 

 

</Grid>

 

</

 

UserControl>

 

1 Answer, 1 is accepted

Sort by
0
Boyan
Telerik team
answered on 03 Nov 2009, 03:26 PM
Hi geekchick,

 The problem is that you need to have only one child. So when you have two controls as children of the RadTabItem which is a HeaderContentControl you get this error. So you just wrap the RadPanelbar and the Listbox with a StackPanel or a Grid and all will be fine. You will have just one child and this will be the Grid/StackPanel. Same with other ContentControls.
 If you need more help please let me know.

Kind regards,
Boyan
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
General Discussions
Asked by
geekchick
Top achievements
Rank 1
Answers by
Boyan
Telerik team
Share this question
or