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

Custom Content in ComboBox using TextBlock ArgumentException

1 Answer 79 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Dennis
Top achievements
Rank 1
Dennis asked on 10 Aug 2009, 02:40 PM
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> 
 

1 Answer, 1 is accepted

Sort by
0
Accepted
Valeri Hristov
Telerik team
answered on 10 Aug 2009, 03:50 PM
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.
Tags
ComboBox
Asked by
Dennis
Top achievements
Rank 1
Answers by
Valeri Hristov
Telerik team
Share this question
or