By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,846 Members | 1,191 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,846 IT Pros & Developers. It's quick & easy.

ListBox and List

P: n/a
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 ?
Aug 3 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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;

Ian Semmel wrote:
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 ?
Aug 4 '06 #2

P: n/a
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).

AnsweringMachine wrote:
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;

Ian Semmel wrote:
>>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 ?

Aug 4 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.