Hello,
I have a RadComboBox declared in xaml:
It is initialized in C#:
At runtime, no item is selected in the combo box.
What am I doing wrong?
Thanks.
I have a RadComboBox declared in xaml:
<input:RadComboBox x:Name="FontFamilyCombo" Width="128" Margin="2,2,1,3" MouseLeftButtonDown="FontFamilyCombo_MouseLeftButtonDown" SelectionChanged="FontFamilyCombo_SelectionChanged" MouseEnter="FontFamilyCombo_MouseEnter" MouseLeave="FontFamilyCombo_MouseLeave" /> |
TextBlock[] family = new TextBlock[4]; |
family[0] = new TextBlock { FontFamily = new FontFamily(TextAttributes.arrFontNames[0]), Text = TextAttributes.arrFontNames[0] }; |
family[1] = new TextBlock { FontFamily = new FontFamily(TextAttributes.arrFontNames[1]), Text = TextAttributes.arrFontNames[1] }; |
family[2] = new TextBlock { FontFamily = new FontFamily(TextAttributes.arrFontNames[2]), Text = TextAttributes.arrFontNames[2] }; |
family[3] = new TextBlock { FontFamily = new FontFamily(TextAttributes.arrFontNames[3]), Text = "Default" }; |
foreach (TextBlock s in family) |
{ |
FontFamilyCombo.Items.Add(s); |
} |
FontFamilyCombo.SelectedIndex = 1; |
FontFamilyCombo.SelectedItem = family[1]; |
What am I doing wrong?
Thanks.