Not sure why I cant get this to work. I have a combobox in WPF. Want to loop through all the controls and set active where criteria are met. I find the match, but cant seem to set the value. this example is modeled after the "selected value" approach... Set SelectedItem of WPF ComboBox
bool match = false;
foreach (ComboBoxItem cbi in cb_Divisinos.Items)
{
if (cbi.Content.ToString().Split('-')[0].Trim() == family.Division.ToString()) {
cb_Divisinos.SelectedValue = cbi.Content.ToString();
match = true;
}
}