I have a ComboBox
that is bound to an EnumerableRowCollection<T>
:
ComboFamilyStatus.ItemsSource = EnumerableRowCollection<TaxDataSet.SourcesOfValuesRow> coll;
My xaml lookes like this:
<ComboBox Name="ComboFamilyStatus" DisplayMemberPath="Description"
Text="{Binding FamilyStatus, Converter={StaticResource FamilyStatusStringConverter}}">
I'm using the DisplayMemberPath
to show the description of the row. The SourcesOfValuesRow has a value and a description and in the combo I want to see the description text. The Text is bound to the database where the FamilyStatus is saved as an int value this is why I added a converter.
My question is if the converter could convert from the int value to the string using the itemsource from the combobox? I don't see that the converter knows anything about the combo. In the meantime I wrote the converter to take again the EnumerableRowCollection<TaxDataSet.SourcesOfValuesRow>
from the database and find there the matched description - this can't be the simplest way to do this!
Any suggestions??