Clear C1ComboBox Selection and Show Placeholder

Posted by: jared.fritsch on 4 December 2017, 3:25 am EST

    • Post Options:
    • Link

    Posted 4 December 2017, 3:25 am EST

    How do I clear a C1ComboBox’s selection to show the placeholder value again? I noticed on initial load, when no selection is made, the SelectedIndex is -1. I tried setting the SelectedIndex back to -1 and I also tried setting the SelectedItem to null. While the SelectedIndex or the SelectedItem may have changed, the C1ComboBox still displayed the previous selected item, rather than the placeholder value.

  • Posted 5 December 2017, 3:20 am EST

    Hi Jared

    I think there’s a bug here. I’d expect setting the Text property to an empty string would clear the display, but it seems like it doesn’t have an effect. I’ll talk to the developers about getting a fix.

    Kelley

  • Posted 5 December 2017, 6:22 am EST

    Sounds good. Thanks, Kelley.

  • Posted 8 December 2017, 3:21 am EST

    A workaround for now seems to be setting the ItemSource to null and then resetting the ItemSource to the original data source.

    MyC1ComboBox.ItemsSource = null;
    MyC1ComboBox.ItemsSource = _myDataSource;
    
  • Posted 15 December 2017, 12:39 am EST

    Thanks, Kelley! I will give this build a test and let you know how it goes.

  • Posted 15 December 2017, 3:26 am EST

    Hi Jared

    I have a prerelease build that you can test locally which should solve the initial issue. QA is reviewing it right now, and if they don’t find any problems it should be published to NuGet as well. Just so you’re aware this build also adds XF 2.5 support.

    //238 is now available on NuGet.org

Need extra support?

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

Learn More

Forum Channels