How to set a bound ComboBox to Nothing?

2 posts, 0 answers
  1. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 05 Mar 2013 Link to this post

    I have a ComboBox that is bound to an observable collection with the selectedItem set to an object in that collection.  All good.

    However, there are times when I want the ComboBox to not have a selected value, so I set the object = Nothing (that is bound to SelectedItem) and this works fine, I see nothing is selected in the ComboBox.  However, what I want to do now is display a text/string value in the combobox like "Not Available".  This doesn't appear to be possible?

    Using the Text property doesn't appear to do anything when the ComboBox is bound to an observable collection.

    Any hints/suggestions?


  2. Rob Ainscough
    Rob Ainscough avatar
    172 posts
    Member since:
    Jan 2010

    Posted 05 Mar 2013 Link to this post

    SOLVED:

    It was very easy, use the "EmptyText" property.

    Rob
  3. DevCraft banner
Back to Top