I am unable to retrieve the DataKeyValue on Insert so I can reference the saved record from the code behind to do further processing. How is this accomplished?
I have used the editeditem.datakeyvalues(e.item.itemindex)("ThisIDFieldName") with an index out of range error.
If I'm not mistaken this solution assumes no one else is inserting records using another connected session as this code will only return the last record inserted. Doesn't appear to be air tight. The control should capture this as a parameter during the insert like the old fassion ADO method and produce it's value if queried.
answered on 29 Dec 2009, 08:23 AM
Below is the code for accessing the inserted item's data key value in the ItemCommand event: