Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Collection as DataSource in ListBox
Message
From
25/02/2005 15:52:03
 
General information
Forum:
ASP.NET
Category:
Forms
Miscellaneous
Thread ID:
00990658
Message ID:
00990706
Views:
22
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
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform