checkBoxList with ValueMember

U

ucasesoftware

To bind my chekboxlist is use this :

Dim list As New DataTable
list.Columns.Add(New DataColumn("bureauGuid",
GetType(String)))
list.Columns.Add(New DataColumn("nomNumero",
GetType(String)))

While myReader.Read
list.Rows.Add((New Object()
{myReader("bureauGuid").ToString, myReader("nomNumero")}))
End While

chkBureaux.DataSource = list
chkBureaux.DisplayMember = "nomNumero"
chkBureaux.ValueMember = "bureauGuid"


--------------------------------------------------------

But when i want to have the value or the display member with this :


Dim i As Integer
Dim s As String
s = "Checked Items:" & ControlChars.CrLf
For i = 0 To (chkBureaux.Items.Count - 1)
If chkBureaux.GetItemChecked(i) = True Then
s = s & "Item " & (i + 1).ToString & " = " &
chkBureaux.Items(i).ToString & ControlChars.CrLf
End If
Next
MessageBox.Show(s)


--------------------------------------

i have system.data.DataRowView !!!!

How can i use a checkboxlist with valuemember !! ??? and retrieve it
with a For... Next
 

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