Custom Content in ComboBox using TextBlock ArgumentException

2 posts, 1 answers
  1. Dennis
    Dennis avatar
    62 posts
    Member since:
    Oct 2007

    Posted 10 Aug 2009 Link to this post

    So, I am sure that I am not approaching this correctly and would like some advice. I am trying to create a drop down of Font selections. I can define it in the XAML (and it recognizes the initial selection value), but when I click the drop down arrow, I receive an Unhandled Exception (Code 4004) System.ArgumentException: Value does not fall within the expected range. I am assuming this is because I don't have a "Binding" mapping for the value into the Content control. How would I setup the Display and Value bindings inline?


     

     
    <telerikNavigation:RadToolBar x:Name="StyleToolbarFont1" Height="29" Margin="0, 4, 0, 2" > 
          
        <telerikInput:RadComboBox x:Name="StyleFontFamily" Width="145">  
     
            <telerikInput:RadComboBoxItem IsSelected="True" Tag=""><TextBlock Text="Font" FontStyle="Italic" /></telerikInput:RadComboBoxItem> 
     
            <telerikInput:RadComboBoxItem Tag="Arial"><TextBlock Text="Arial" FontFamily="Arial" /></telerikInput:RadComboBoxItem> 
     
            <telerikInput:RadComboBoxItem Tag="Arial Black"><TextBlock Text="Arial Black" FontFamily="Arial Black" /></telerikInput:RadComboBoxItem> 
              
            <telerikInput:RadComboBoxItem Tag="Comic Sans MS"><TextBlock Text="Comic Sans MS" FontFamily="Comic Sans MS" /></telerikInput:RadComboBoxItem> 
     

  2. Answer
    Valeri Hristov
    Admin
    Valeri Hristov avatar
    2252 posts

    Posted 10 Aug 2009 Link to this post

    Hi Dennis,

    This looks like a bug. I will log it for resolution. In the mean time, I would recommend using the following XAML instead:
    <telerikInput:RadComboBoxItem FontFamily="Arial" Content="Arial" ... />

    Regards,
    Valeri Hristov
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Back to Top