How do I unbind a WebDropDown? I have WebDropDown that is bound to a dataset. Now on a condition, I have to clear the datasource or show it empty.
Simple code does not work!
WebDropDown1.DataSource = null;
WebDropDown1.DataBind();
I would appreciate any help from the user community.
Thanks
Hi,
Instead of setting the DataSource to "null", you should set it to an empty data source, for example if you bind to a list,
WebDropDown1.DataSource = new List<MyClass>();
Thanks,
Angel
setting datasource=nothing works better then Null