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

RadComboBox inside RadExpander

1 Answer 128 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Srinivas
Top achievements
Rank 1
Srinivas asked on 04 Jun 2009, 04:52 AM
Hi,

I am trying to include RadComboBox inside RadExpander but I am getting "The property 'Content' is set more than once" error message. Below is the code, can you please help me?

<

 

telerikCommon:RadExpander Grid.Row="1" Grid.Column="0">

 

     

<telerikCommon:RadExpander.Header>

 

         

<TextBlock x:Name="SelectCompany" Text="Select Company" Visibility="Visible" />

 

     

</telerikCommon:RadExpander.Header>

 

     

<telerikCommon:RadExpander.Content>

 

     

<telerikCommon:RadWrapPanel x:Name="SelectCompanyPanel" IsAnimated="True" 
                AnimationDuration
="333"  Orientation="Horizontal"/>

 

         

<telerikInput:RadComboBox x:Name="CompanyComboBox" Width="200" Margin="4" Height="40" >

 

                 

<telerikInput:RadComboBox.ItemTemplate>

 

                     

<DataTemplate>

 

                         

<StackPanel>

 

                             

<TextBlock Text="{Binding Company}" />

 

                              

<StackPanel Orientation="Horizontal">

 

                                 

<TextBlock Text="{Binding CompanyName}" />

 

 

                              </StackPanel>

 

                        </StackPanel>

                     

</DataTemplate>

 

 

 

                </telerikInput:RadComboBox.ItemTemplate>

 

 

        </telerikInput:RadComboBox>

 

 

</telerikCommon:RadExpander.Content>

 

 

</telerikCommon:RadExpander>

 

 

I was able to include RadTreeView without any issue but not combo box. Please help me at the earliest possible.

Thanks
Srinivas

1 Answer, 1 is accepted

Sort by
0
Kaloyan
Telerik team
answered on 04 Jun 2009, 02:00 PM
Hello Srinivas,

You have to place the RadComboBox inside the RadWrapPanel or remove the RadWrapPanel. The prbolem here is that you are putting two controls as a content of the RadExpander which is not possible. Check the code snippet below with the correct solution:

<Grid x:Name="LayoutRoot"
        <telerikControls:RadExpander Grid.Row="1" Grid.Column="0"
            <telerikControls:RadExpander.Header> 
                <TextBlock x:Name="SelectCompany" Text="Select Company" Visibility="Visible" /> 
            </telerikControls:RadExpander.Header> 
            <telerikControls:RadExpander.Content> 
                <telerikControls:RadWrapPanel x:Name="SelectCompanyPanel" IsAnimated="True" 
                        AnimationDuration="333" Orientation="Horizontal"
                    <telerikInput:RadComboBox x:Name="CompanyComboBox" Width="200" Margin="4" 
                            Height="40"
                        <telerikInput:RadComboBox.ItemTemplate> 
 
                            <DataTemplate> 
 
                                <StackPanel> 
 
                                    <TextBlock Text="{Binding Company}" /> 
 
                                    <StackPanel Orientation="Horizontal"
 
                                        <TextBlock Text="{Binding CompanyName}" /> 
 
                                    </StackPanel> 
 
                                </StackPanel> 
 
                            </DataTemplate> 
 
                        </telerikInput:RadComboBox.ItemTemplate> 
                    </telerikInput:RadComboBox> 
                </telerikControls:RadWrapPanel> 
 
            </telerikControls:RadExpander.Content> 
 
        </telerikControls:RadExpander> 
    </Grid> 
 



Best wishes,
Kaloyan
the Telerik team

Instantly find answers to your questions on the newTelerik Support Portal.
Check out the tipsfor optimizing your support resource searches.
Tags
ComboBox
Asked by
Srinivas
Top achievements
Rank 1
Answers by
Kaloyan
Telerik team
Share this question
or