CheckListBox and value

  • Thread starter Thread starter Nicolas
  • Start date Start date
N

Nicolas

How do I get the vaue of an item in the checklistbox control
My control is populated with a datasource and I assigned the DisplayMember
as well as the ValueMember
..clb_DataPicker.DataSource = myDatatable

..clb_DataPicker.DisplayMember = "CompanyName"

..clb_DataPicker.ValueMember = "Company_ID"

..clb_DataPicker.Refresh()

Dim s As String

For x As Integer = 0 To .clb_DataPicker.Items.Count - 1

'/////////////////////////////////

I got the Text right but I want the Value

'If .clb_DataPicker.GetItemChecked(x) Then s =
..clb_DataPicker.GetItemText(.clb_DataPicker.Items.Item(x))

Next
 
Silly me What about if I was looking more in detail. May be too much coding
today
If .clb_DataPicker.GetItemChecked(x) Then s = .clb_DataPicker.SelectedValue

give me the result

Thanks to myself
 
Back
Top