I used code below in a button to get all checkbox value and then assign to a arraylist. It works fine.
But, once copied it to a tollbar, arraylist only store first value.
Is my code wrong?
Dim aList As New ArrayList
Dim CheckedRows As List(Of DataGridViewRow) = gridview1.GetChecked("Select")
If CheckedRows.Count <> 0 Then
Dim sList As String = ""
For Each item In CheckedRows
aList.Add(item.Cells("ID").Value.ToString)
Next
But, once copied it to a tollbar, arraylist only store first value.
Is my code wrong?
Dim aList As New ArrayList
Dim CheckedRows As List(Of DataGridViewRow) = gridview1.GetChecked("Select")
If CheckedRows.Count <> 0 Then
Dim sList As String = ""
For Each item In CheckedRows
aList.Add(item.Cells("ID").Value.ToString)
Next