Clearing items before refreshing dataset from listbox

  • Thread starter Thread starter sweetiecakes
  • Start date Start date
S

sweetiecakes

Hi

I have a ListBox which is binded to a dataSet. When I need to refresh
this dataSet, it works, but the old entries don't get removed from the
listbox. Items.Clear() doesn't work when a DataSource is set.

How would I clear all the items from the ListBox before refreshing the
dataset?

thanks
 
Hi

ListBox is a mirror of dataset in this case. If you want to clear listbox
clear the source, or just detach.

Regards, Alex
[TechBlog] http://devkids.blogspot.com



s> Hi
s>
s> I have a ListBox which is binded to a dataSet. When I need to refresh
s> this dataSet, it works, but the old entries don't get removed from
s> the listbox. Items.Clear() doesn't work when a DataSource is set.
s>
s> How would I clear all the items from the ListBox before refreshing
s> the dataset?
s>
s> thanks
s>
 
Back
Top