Get value of checked item in CheckedListBox

by Kareem Allam 18. September 2011 18:31

 after bind CheckedListBox with data you can get value of checked items

For i As Integer = 0 To CheckedListBox1.CheckedItems.Count - 1
                    Dim XDRV As DataRowView = CType(CheckedListBox1.CheckedItems(i), DataRowView)
                    Dim XDR As DataRow = XDRV.Row
                    Dim XDisplayMember As String = XDR(CheckedListBox1.DisplayMember).ToString()
                    Dim XValueMember As String = XDR(CheckedListBox1.ValueMember).ToString()
                    MsgBox("DisplayMember : " & XDisplayMember & "   - ValueMember : " & XValueMember )

 now you can use the value or Display of checked items in CheckedListBox from the 2 variables XDisplayMemberXValueMember in the loop


hope to be useful ,,, 

If you enjoyed this post, make sure you subscribe to my RSS feed!


If you would like to find value services with excellent quality and cost effectiveness and with a focus on speed , Just Follow

 Egypt Development Freelance Team.

Month List

Page List