Displaying Text in a RibbonComboBox not from an item

Oct 7, 2009 at 9:22 PM

I have the following RibbonComboBox in my XAML:

<ribbon:RibbonComboBox Name="MyComboBox" SelectionChanged="MyComboBox_SelectionChanged" 
				SelectedIndex="{Binding itemIndex, Mode=TwoWay}" ItemsSource="{Binding comboxBoxItemsSource}" />

 

The problem that I have is that sometimes the "comboBoxItemsSource" can change, thus the list of available options that can be selected might change.  If the source collection changes, I would still like to display the text of the previous selection in the combo box text box, although that selection won't be available to select anymore when the user goes to make a selection in the combo box.

In other words, let's say I can make a choice between items A, B, and C.  I choose A, and A is displayed in the text box of the ribbon combo box.  Then some other stuff happens somewhere else in my program, and suddenly only B and C are valid options.  I want to still display A in the text box (showing the user that in fact he/she picked A last time) even though A is not a valid choice anymore and is not included in the combo box items list.

Suggestions?  Thanks.