I’ve got a few cascading comboboxes on my WPF form, each bound to a List. The selection from combobox A is used as a parameter in my LINQ to populate combobox B, whose selection is used as a parameter in my LINQ to populate combobox C.
Each of these comboboxes has a Text value such as “Please select a deparment…” that should appear when no selection has been made. I’ve set the comboboxes’ IsEditable property to true so that the text appears in the combobox prior to any selections being made. This all works properly.
My problem is that after an initial runtime use, this text disappears and no longer appears in a combobox with no selected value. Upon instantiation, all three comboboxes show default text.
I’ve tried setting the SelectedIndex value to -1 to no avail. Am I missing something?
The text in an editable ComboBox will only be shown initially. From the MSDN doc on ComboBox.Text:
The Remarks section states:
As soon as an item is selected, the text will be set to the text of the selected item and never restored to the initial value.