ListBox.DataSource clears exisiting items

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hi,

When I bind data source to ListBox.DataSource, it clears (deletes) existing
items in the ListBox. I want to preserve existing items when I set
ListBox.DataSource.

Thanks,
Mahesh
 
Hi,
If you are using dataset as datasource to ListBox then you can think of
merging old dataset and new dataset,then assign new merged dataset as
datasource to listbox.In this way it will preserve existing items also.Find
below a link which shows how to merge datasets.
http://msdn2.microsoft.com/en-us/library/803bh6bc.aspx
Hope this helps
 
Hello mahesh,

This is not poosible. You can only do this by two ways:

1. Add data source items manually to list box.
2. Add list box items to data source and then bind
 

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

Back
Top