nebakanezzar
Member
- Joined
- Apr 2, 2010
- Messages
- 6
- Programming Experience
- Beginner
Hey All,
I am in need of a little help. I am populating a listbox from a database, and then i want to move the selected items to a 2nd listbox.
1 - the 1st listbox is populated with peoples first names from a database, this works fine.
2 - when i select the name(s) i wish to move, the button click event does not populate the 2nd listbox with the selected name(s), but rather "System.Data.DataRowView"
here is the code i am using for the button click.:
Dim intAdd As Integer
For intAdd = 0 To lstName.Items.Count - 1
If lstName.GetSelected(intAdd) = True Then
lstAdd.Items.Add(lstName.Items(intAdd))
End If
Next intAdd
My question is:
1 - how do i get the 2nd list box to show the selected name(s) from the 1st listbox? i assume i need to convert it somehow, but i am not sure how?
Side questions:
2 - in the database i have a field for first name, and a field for last name. i would like to use both fields to populate the 1st listbox, so the full name is displayed, if possible.
3 - optimally, i would like to use a checklistbox for the 1st listbox, but it seems there is no option to databind the checklistbox, and i am not sure how to code this. Is this possible? i have done some searching and googleing to no avail.
thanks
neb.
I am in need of a little help. I am populating a listbox from a database, and then i want to move the selected items to a 2nd listbox.
1 - the 1st listbox is populated with peoples first names from a database, this works fine.
2 - when i select the name(s) i wish to move, the button click event does not populate the 2nd listbox with the selected name(s), but rather "System.Data.DataRowView"
here is the code i am using for the button click.:
Dim intAdd As Integer
For intAdd = 0 To lstName.Items.Count - 1
If lstName.GetSelected(intAdd) = True Then
lstAdd.Items.Add(lstName.Items(intAdd))
End If
Next intAdd
My question is:
1 - how do i get the 2nd list box to show the selected name(s) from the 1st listbox? i assume i need to convert it somehow, but i am not sure how?
Side questions:
2 - in the database i have a field for first name, and a field for last name. i would like to use both fields to populate the 1st listbox, so the full name is displayed, if possible.
3 - optimally, i would like to use a checklistbox for the 1st listbox, but it seems there is no option to databind the checklistbox, and i am not sure how to code this. Is this possible? i have done some searching and googleing to no avail.
thanks
neb.