Thanks for pointing that out, I have just fixed that and also added the following
VB to my code behind page:
This code basically sets up an array, then goes through each row checking if the checkbox is checked off.. If the checkbox is checked off then it pulls the value from the Barcode cell.
The array then prints to a textbox control labeled textbox1.
My problem is that only 1 value is getting printed out the textbox control and not all the rows that I have selected by checking off the checkbox...
What am I missing here?
Code:
Dim arr AsNew ArrayList()
For i AsInteger = 0 To GridView1.Rows.Count - 1
Dim cb As CheckBox = DirectCast(GridView1.Rows(i).Cells(0).FindControl("CheckBox1"), CheckBox)
If cb IsNotNothingThen
If cb.Checked Then
'get the value of BarCode here
Dim barCode AsString = GridView1.Rows(i).Cells(2).Text
' contains the column for BarCode
'add the value to ArrayList
arr.Add(barCode)
'TextBox1.Text = barCode.ToString()
Dim j AsInteger
For j = 0 To arr.Count - 1
Console.WriteLine(CStr(arr.Item(j)))
Dim output AsString
output = (CStr(arr.Item(j)))
TextBox1.Text = output
Next
EndIf
EndIf
Next
EndSub
Thanks for your help guys!