RadComboBox inside RadExpander

2 posts, 0 answers
  1. Srinivas
    Srinivas avatar
    48 posts
    Member since:
    May 2009

    Posted 03 Jun 2009 Link to this post

    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

  2. Kaloyan
    Admin
    Kaloyan avatar
    920 posts

    Posted 04 Jun 2009 Link to this post

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