ListBox and List

  • Thread starter Thread starter Ian Semmel
  • Start date Start date
I

Ian Semmel

If I have a List<> and a ListBox.DataSource = List then it initially displays
OK, but if I change the order of the List, the displayed text in the ListBox
doesn't.

How do you make this happen ?
 
The ListBox internally keeps its own copy of the data. So you'll have
to rebind to the data source like this:
ListBox1.DataSource = null;
ListBox1.DataSource = sourceList;
 
Thanks, I actually did away with the datasource and did it myself.

Is there any reason, do you think, why they didn't make the collection for a
ListBox a List ? This would then enable you to use the List functions on a
ListBox (which seems logical to me).
 

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