When I click on
btnAssignId, grdResult has 4 rows, but in debug mode in loop I see 5 iterations and on 5th Exeption throw
at line where I try GetDataKeyValue
Private
Sub
btnAssignId_Click(
ByVal
sender
As
Object
,
ByVal
e
As
System.EventArgs)
Handles
btnAssignExistingId.Click
If
Not
String
.IsNullOrEmpty(tbMatlID.SelectedValue)
Then
For
Each
item
As
GridItem
In
grdResult.Items
If
item IsNot
Nothing
Then
Dim
griddata =
CType
(item, GridDataItem)
Dim resultId = griddata.GetDataKeyValue("ResultId")
Update(resultId, tbMatlID.SelectedValue)
End
If
Next
End
If
End
Sub