Running the code as is the line ' Dim ProductID As String = item.OwnerTableView.DataKeyValues(item.ItemIndex)("Observation_ID").ToString()' Gives the following error:
Object reference not set to an instance of an object.
This is because I cannot use the datasourcenames without it erroring on insert.
If I add Observation ID to the datakeynames it does return the correct row, but when I insert a record in the nested grid I get this error.
'There was a problem extracting DataKeyValues from the datasource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the datasource'
That is why I can use the DatakeyValues but rather use a hidded grid boud column. Why would extracting the value from a grid bound column return the one above, could it be an ordinal problem ie one method is 1,2,3 and the other 0,1,2.