how can I get the selected text on the SelectionChanged event of the comboBox
here is my code
<ComboBox x:Name="cboRecordType" Margin="2,0" Height="23" Grid.Column="1" VerticalAlignment="Center" SelectionChanged="ComboBox_SelectionChanged">
<ComboBoxItem Content="Weight"/>
<ComboBoxItem Content="Height"/>
<ComboBoxItem Content="Blood Pressure"/>
<ComboBoxItem Content="Blood Gulocose"/>
</ComboBox>
cboRecordType.Text is empty, didn’t cantain the selected Text, how to get that
In the
SelectionChangedevent handler, you can either look at thecboRecordType.SelectedItemproperty on the combobox itself, or you can look at theAddedItemsproperty of theSelectionChangedEventArgspassed into the event handler.When an item is selected, the item is added to the
AddedItemsarray property of the event args. (multiple items in a multi select case). When an item is deselected, it is added to theRemovedItemsarray property of the event args.