I truly do hate to ask such a crayon-question... I'm trying to clear, not remove a drop down combo list in VSC#. My ddl lets the user choose the payRate of an employee. I've researched everywhere, even here, and everything suggests using..
cmboPayRate.Items.Clear(); .. or
cmboPayRate.SelectedIndex = - 1;
I even threw in
cmboPayRate.SelectedItem = -1;
for safe measure. Nothing working. Again, I know this is easy(should be), but not working for me. Any suggestions would be greatly appreciated.
Thanks -Matt.
to clear a dropdownlist, you do DropDownList1. Items. Clear();
ClearSelection() did exactly what I needed it to do. It cleared the dropdownlist selection so that nothing was selected. The box was blank, but when you dropdown the list, all the options are still available to choose from.
Just use . empty() : // snip... }). done(function (data) { // Clear drop down list $(dropdown).
try
DropDownList1.Items.Clear();
No hidden and clear the Drop Down List.
you can do as below
while(cmboPayRate.Items.Count>0)
cmboPayRate.Items.RemoveAt(0);
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