<ComboBox Grid.Row="1" Grid.Column="0" Width="Auto" Name="cmbBudgetYear">
<ComboBoxItem Content="2009" />
<ComboBoxItem Content="2010" />
<ComboBoxItem Content="2011" />
<ComboBoxItem Content="2012" />
</ComboBox>
How do I set the selected item to the current year in the code behind?
Something like...
cmbBudgetYear.SelectedItem = cmbBudgetYear.Items(
get the item with the Now.Year.ToString)
question from:https://stackoverflow.com/questions/3391195/set-selecteditem-of-wpf-combobox