Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Collection as DataSource in ListBox
Message
De
25/02/2005 15:52:03
 
Information générale
Forum:
ASP.NET
Catégorie:
Formulaires
Divers
Thread ID:
00990658
Message ID:
00990706
Vues:
23
This doesn't seem to happen if you are using a DataTable as your DataSource. Add a new row and it's automatically reflected in the ListBox.

When using a Collection, I got it to refresh by setting the DataSource to null, then setting it back to the Collection. Kludgy, I know, but the ListBox.Refresh() doesn't seem to do squat.

~~Bonnie


>I added a listbox to my form. I set listBox.DataSource to a collection object (the collection object's class is a subclass of the CollectionBase). So far everything is fine the elements in the collections object displays just like expected. Then I added a button to add a new item to the collection object but the listbox does not update. I can see that the collection object item count increased.
>It is almost like a refresh issue.
>Any ideas of what I can do to get the listbox to update or refresh?
>Einar
Bonnie Berent DeWitt
NET/C# MVP since 2003

http://geek-goddess-bonnie.blogspot.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform