Please review the site disclaimer before downloading or using content found on this site
Written by: Steve Gray 10/8/2009 2:55 PM
Here's how to loop through an ASP.NET datagrid
Dim a As Int16
For a = 0 To Me.grdLines.Items.Count - 1
'get a reference to the row id
intDexRowID = _
CType(Me.grdLines.Items(a).FindControl("lblDexRowID"), Label).Text
Next
Another way:
For Each item As DataGridItem In Me.Grid1.Items
'get a reference to a control
txtQuantity = CType(item.FindControl("txtQuantity"), TextBox)
'get a reference to a bound cell
myVar = item.Cells(0)
0 comment(s) so far...