I need to iterate through the items (rows) in a grid and for each row I need to extract the datakeyvalue. Here is how I thought it would be done (This is in the GridDataBound event):
But the strPersonNumber always = Nothing and never get's the key for the row.
For Each gvRow As Telerik.Web.UI.GridItem In rgViewableDependents.MasterTableView.Items |
strPersonNumber = rgViewableDependents.MasterTableView.DataKeyValues(gvRow.ItemIndex)("PersonNumber") |
chkViewable = gvRow.FindControl("chkViewable") |
Next |
But the strPersonNumber always = Nothing and never get's the key for the row.
rgViewableDependents.MasterTableView.DataKeyValues.Count = 3 and there are 3 rows in the grid, so i'm not sure why it isn't picking up the DataKeyValue. What am I doing wrong?
Thanks!