I have a wpf app with a combobox like this
<ComboBox name="cmbBx1">
<ComboBoxItem Name=Jan">January</ComboBoxItem>
<ComboBoxItem Name=Feb">February</ComboBoxItem>
</ComboBox>
In the code behind I need to get the value of the item that was selected to pass to a stored procedure. I can get part of the way by doing this:
ComboBoxItem cbi = (ComboBoxItem)cmbBx1.ItemContainerGenerator.ContainerFromItem(cmbBx1.SelectedItem);
The problem is that the output of that gives me something like System.Windows.Controls.ComboBoxItem: January
I just need the value, i.e. "January" returned. What am I missing?