<ComboBox Grid.Column="1" Grid.Row="4" Height="23" HorizontalAlignment="Left" Name="comboBox1" VerticalAlignment="Top" Width="120"> <ComboBox.Items> <ComboBoxItem Content="ASX_D"></ComboBoxItem> <ComboBoxItem Content="FOREX_D"></ComboBoxItem> <ComboBoxItem Content="FOREX_H"></ComboBoxItem> <ComboBoxItem Content="FUTERE_H"></ComboBoxItem> <ComboBoxItem Content="FUTURE_D"></ComboBoxItem> <ComboBoxItem Content="TRADE_H"></ComboBoxItem> </ComboBox.Items> </ComboBox>
string st=comboBox1.SelectedItem.ToString();
System.Windows.Controls.ComboBoxItem
string st = ((ComboBoxItem)comboBox1.SelectedItem).Content.ToString();
var itemType = MyCombBox.SelectedItem.GetType(); var pi = itemType.GetProperty(MyCombBox.DisplayMemberPath); var stringValue = pi.GetValue(MyCombBox.SelectedItem, null).ToString();
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)