|
-
Dec 21st, 2006, 09:20 AM
#1
Thread Starter
Fanatic Member
retrieve selectedvalues from checkedlistbox ion .net 2.0
This is how a checkedlistcontrol is populated:
chklstUserRoles.DataSource = dsUsersAndRoles.Tables("Roles").DefaultView
chklstUserRoles.DisplayMember = "Name"
chklstUserRoles.ValueMember = "RoleID"
I would like to loop through a checkedlistBox control and collect the IDs that is allocated to each checked item in the control.
This does not quite work:
Dim i As Integer
For i = 0 To chklstUserRoles.CheckedItems.Count - 1
strRoleIds += chklstUserRoles.SelectedValue.ToString() + ","
Next i 'strRoleIds += chklstUserRoles.CheckedItems[i].ToString() + ",";
Thanks
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|