I am trying to set the selected item in my silverlight combobox from a string.
In this example lets say I have a combobox named "MyComboBox" as follows:
<ComboBox Height="23" x:Name="MyComboBox" Width="200" HorizontalAlignment="Left">
<ComboBoxItem Tag="0" Content="Pizza" IsSelected="True"/>
<ComboBoxItem Tag="1" Content="Soda"/>
<ComboBoxItem Tag="2" Content="Wings"/>
<ComboBoxItem Tag="3" Content="Bread Sticks"/>
</ComboBox>
I am randomly selecting a string value above from a list to simulate a users saved preference. The problem I am facing is trying to grab the index of "MyComboBox" from a string.
I've tried using MyComboBox.items wtih LINQ but that has taken me nowhere.
There are some similar questions here on stack overflow but none of these have been answered.