How do I clear a combobox in WPF? I have tried this code:
private void btClear1_Click(object sender, RoutedEventArgs e)
{
txtID.Text = String.Empty;
this.cbType.SelectedItem = -1;
}
cbTypion.SelectedItem = -1
to clear the selection
cbType.Items.Clear()
to clear all the items
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With