SelectionBoxTemplate not working of Combobox

2 posts, 1 answers
  1. Md.Hasanuzzaman
    Md.Hasanuzzaman avatar
    31 posts
    Member since:
    Apr 2011

    Posted 16 Jun 2012 Link to this post

    I am writing this lines of code 

      <telerik:RadComboBox Height="28" Margin="0,112.051,12,0" Grid.Row="1" VerticalAlignment="Top">
            <TextBlock Text="{Binding}" Foreground="Red"/>   
          <telerik:RadComboBoxItem Content="Item 1"/>
          <telerik:RadComboBoxItem Content="Item 2"/>
          <telerik:RadComboBoxItem Content="Item 3"/>
    But this is not working. Please tell me what i am doing worng ?
    Thank you.
  2. Answer
    Vladi avatar
    743 posts

    Posted 18 Jun 2012 Link to this post

    Hi Hasanuzzaman,

    The RadComboBox control ignores the SelctionBoxTemplate property when there are statically declared RadComboBoxItem's and uses the ContentTemplate of the selected RadComboBoxItem. There are two solutions to this issue:

    1. To dynamically declare ComboBox items via bindings.
    2. Use <system:String> to statically declare content items. Here is a simple code representing that:
                SelectionBoxTemplate="{StaticResource SelectionBoxTemplate}"
                <system:String>Item 1</system:String>
                <system:String>Item 2</system:String>
                <system:String>Item 3</system:String>

    Hope this helps.

    All the best,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

  3. DevCraft R3 2016 release webinar banner
Back to Top