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.
Checkout the following code library that shows how to access the last inserted record in PreRender event. I hope this will help you. Select Last Inserted Row
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.
0
Tsvetoslav
Telerik team
answered on 29 Dec 2009, 08:23 AM
Hi Peter,
Below is the code for accessing the inserted item's data key value in the ItemCommand event: