Setting SelectedIndex of invisible C1ComboBox causes exception

Posted by: jared.fritsch on 19 February 2018, 9:11 am EST

    • Post Options:
    • Link

    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.

  • Posted 20 February 2018, 12:23 am EST

    I couldn’t observe this issue with build 2.5.20173.241. Please try with this build and let me know if you’re still facing this issue.

  • Posted 20 February 2018, 1:01 am EST

    I did try with build 2.5.20173.241. That’s what I listed in my original post.

  • Posted 20 February 2018, 7:51 pm EST

    Sorry for the confusion. I think the app didn’t get updated correctly earlier with the build, hence didn’t show the error. I could observe the issue after uninstalling the app and then re-running the sample. I’ll forward this to the concerned team and will need some time before I can get back to you with an update. (Tracking Id for internal reference - 310105).

  • Posted 27 February 2018, 12:46 am EST

    Hi Jared

    This bug should be fixed in the next release in a couple weeks. The bug itself is actually already fixed in development, though there is some other QA and regression testing left to do on these builds. I’ll let you know once it’s available.

    Kelley

  • Posted 27 February 2018, 1:58 am EST

    Thanks for the update, Kelley.

  • Posted 1 April 2018, 11:34 pm EST

    Hi Jared,

    The fixed build (2.5.20181.267) is available on Nuget. Kindly update your application with this build.

    Thanks

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels