How do i clear a list box
-
Hi all. Is it that i am using VS .Net 2003 that there is no method to clear a list box once it is populated. I need to clear the list Box but every time i attempt using the method Clear() from Class ListControls, i get an error. please help.
Wamuti: Any man can be an island, but islands to need water around them! Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
-
Hi all. Is it that i am using VS .Net 2003 that there is no method to clear a list box once it is populated. I need to clear the list Box but every time i attempt using the method Clear() from Class ListControls, i get an error. please help.
Wamuti: Any man can be an island, but islands to need water around them! Edmund Burke: No one could make a greater mistake than he who did nothing because he could do only a little.
Hi Wamuti, Try using the following line of code if it is a Bound ListBox:
this.listBox1.DataSource = null;
For Unbound ListBox:this.listBox1.Items.Clear()
I hope this would be helpful.John Adams ComponentOne LLC. www.componentone.com
modified on Thursday, September 4, 2008 10:33 AM
-
Hi Wamuti, Try using the following line of code if it is a Bound ListBox:
this.listBox1.DataSource = null;
For Unbound ListBox:this.listBox1.Items.Clear()
I hope this would be helpful.John Adams ComponentOne LLC. www.componentone.com
modified on Thursday, September 4, 2008 10:33 AM