Posted 15 December 2017, 1:23 am EST
On a lot of my C1ComboBoxes, I am setting a default SelectedIndex.
<input:C1ComboBox
x:Name="MyComboBox"
SelectedIndex="0" />
This throws an “Object reference not set to an instance of an object” exception. I tried setting the SelectedIndex in code instead, and received the same exception.
public MyView()
{
InitializeComponent();
MyComboBox.ItemsSource = _myDataSource;
MyComboBox.SelectedIndex = 0;
}
But, if I set the SelectedIndex within some other event, it seems to work just fine.
private void MyButton_OnClicked(object sender, EventArgs e)
{
MyComboBox.SelectedIndex = 0;
}
I am using v2.5.20173.238 (pre-release as of this writing)