If for textbox it is textbox1.clear
, etc.
What is the equivalent for combobox to clear the value.
The easiest way to clear the second combobox is to just use Reset(). That will clear all the current selections and reset the combobox to its default selection.
When you data bind a control, it will synchronize with that collection. In order to clear the items in your ComboBox set it's DataSource to null. Save this answer.
Clear() it clears all the items in the combobox and when i use ComboBox1. SelectedIndex = -1 it doesn't show any text and when i choose any of the entry, it doesn't show, it's blank. Well unless you've wiped all that from the db, you should unbind the combo from the data.
Try using combobox.Items.Clear()
If your combobox
is set with the DropDownList
, then
use Combobox1.SelectedIndex = -1
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