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

ListBox.SelectedItem = "whatever" fails with data-bound?

P: n/a
Is this a feature of ListBox that when using a DataSource, the
SelectedItem acts different?

Added ListBox1 and ListBox2 to a form.
ListBox1 is bound to a DataSource where DisplayedMember=name and
ValueMember=id from the table.
ListBox2 filled by AddRange(New String() {"One", "Two", "Three",
"Four", "Five"})

ListBox2.SelectedItem = "Three"
selected the item "Three" in the Items.

but ListBox1.SelectedItem = "(name of any item in the list)"
does not cause any item to be selected.

How does one use .SelectedItem = "value" with data-bound list
controls?
Feb 18 '08 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Grok,

That depends on your datasource, however it has at least to implement in
whatever way the Ilist's

Cor

Feb 18 '08 #2

This discussion thread is closed

Replies have been disabled for this discussion.