I have just started using WPF forms instead of Windows Forms forms. In a Windows Forms form I could just do:
ComboBox.SelectedValue.toString();
Create a ComboBox SelectionChanged Event and set ItemsSource="{Binding}" in the WPF design:
Code:
private void comboBox1_SelectionChanged(object sender, SelectionChangedEventArgs e) { string ob = ((DataRowView)comboBox1.SelectedItem).Row.ItemArray[0].ToString(); MessageBox.Show(ob); }