Groups > Borland > Delphi winforms controls > How To Clear a Listbox Using an ArrayList DataSource?




How To Clear a Listbox Using an ArrayList DataSource?

How To Clear a Listbox Using an ArrayList DataSource?
Fri, 17 Aug 2007 12:16:21 -070
How do I clear  a Listbox that uses an ArrayList for its DataSource?

If I try MyListBox.Items.Clear I get an exception telling me I can't change 
the listbox's ItemCollection if the DataSource is set.

If I try MyArrayList.Clear I see that the array is cleared but the listbox 
is not. If I then add new items to the array they do not show in the 
listbox.

So how do I clear a listbox if the datasource is set?

-Andy 

Post Reply
about | contact