Link to home
Start Free TrialLog in
Avatar of natethegreat1977
natethegreat1977Flag for Afghanistan

asked on

ListView CheckBox Value

I am trying to get the value of an ID("ToppingID") from a ListView in in VB.NET and add it to a list.

I can do it with the GridView like this:

Dim chk As CheckBox
Dim list As New List(Of String)
        
        For Each rowItem As GridViewRow In GridView1.Rows
            chk = CType(rowItem.Cells(0).FindControl("CheckBox2"), CheckBox)
            If chk.Checked Then
                list.Add(GridView1.DataKeys(rowItem.RowIndex)("ToppingID").ToString()) 
            End If
        Next

Open in new window


How do I do the same thing only with a list view?
What do I use instead of rowItem and RowIndex??
ASKER CERTIFIED SOLUTION
Avatar of BuggyCoder
BuggyCoder
Flag of India image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Amandeep Singh Bhullar
This question has been classified as abandoned and is closed as part of the Cleanup Program. See the recommendation for more details.