listbox databind and mutli-select by code

D

Doudou

Hello,

(I'm french, so my english isn't very good)

I use a dataTable to fill a listbox (listbox databinded). This listbox
has a valuemember (integer) and a displaymember (string) differents.

In my code, I must select one or more items in the listbox. The only
information I have is the list of items corresponding to the
valuemember that I must select.

I try many solution : using integer, dataRowView to find the listbox
item to select but in all case, I have errors. I don't know what I must
do ????

Thanks for all response
Steph
 
D

Doudou

This example doesn't resolve my problem but it takes me an idea to
resolve my problem and not it's work well.

In fact I looped on values array to select in my listbox and I tried to
find which items in the listbox match the current item of my values
array.
Now I loop on the listbox and if the current item of the listbox is
contained in my values array, I mark it as selected. The properties and
methods of arrays avoid me to do two loops. It's more simply in this
manner.

Thanks
 

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

Top