Clearing items before refreshing dataset from listbox

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
 
A

Alex Meleta

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>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top