selectedValue in a checkedListBox

  • Thread starter Thread starter touf
  • Start date Start date
T

touf

Hi,
I've a chechked listBox bound to a datasource like this
Me.lstFournisseurs.DataSource = myTable

Me.lstFournisseurs.DisplayMember = "nom"

Me.lstFournisseurs.ValueMember = "code"



H

I like to know the code of a checked item (the first one for example) , how
can I have it.

I've tested the selectedValue property but it gives the code of the selected
item not the checked one.

Thanks.
 
Hi Touf,

The CheckedListBox has a CheckedItems property which will give you a
collection of the items that are checked. There's also the CheckedIndices
property which will give you the corresponding index numbers.

Regards,
Fergus
 
Hi touf
Dim a As DataRowView
For Each a In CheckedListBox1.CheckedItems()
TextBox2.Text &= a.Item(0) & " " & a.Item(1) & vbNewLine ' a.item(0)
is the key
Next


Best regards

Jan
 
Back
Top