Posted 19 February 2018, 9:11 am EST
Xamarin.Forms
C1 version: v2.5.20173.241
Tested platforms: UWP
We have found that if you set the SelectedIndex (or SelectedItem) of an invisible C1ComboBox more than once, you will get an ‘Object reference not set to an instance of an object.’ exception.
This does not occur on v2.5.20173.238.
Say I have two C1ComboBoxes. One is visible and one isn’t.
<input:C1ComboBox
x:Name="TheComboBox"
DisplayMemberPath="Property1" />
<input:C1ComboBox
x:Name="TheComboBox2"
DisplayMemberPath="Property1"
IsVisible="False" />
If I click a button to cause the SelectedIndex to change, the C1ComboBox does as expected the first time. But if I do it again and cause the SelectedIndex to change again, I get the exception. It works just fine for visible C1ComboBoxes.
private void Button_OnClicked(object sender, EventArgs e)
{
TheComboBox.SelectedIndex = TheComboBox.SelectedIndex + 1;
TheComboBox2.SelectedIndex = TheComboBox2.SelectedIndex + 1;
}
I have not found a workaround for this yet, so until we do, a fix is pretty urgent.