I have a RadGrid that binds to a collection of custom object. In my application users can insert/update the rows of the grid and the changes will not be persisted to the database until they click on a save button. Each row has a key column containing the key value (ProviderLanguageID) assigned to each of the object when data is persisted to DB.
The grid's markup is like this:
When multiple rows are inserted to the grid, and one of the rows is subsequently edited (before saved to DB), the edited row is accessible in UpdateCommand event like this:
I'm using the key value to locate the actual custom object in the collection stored in the page.
This works if each of the record already has a key. When a new record is created, the key value is empty (Guid.Empty). So we'd have to use different means to locate the custom object. I'm thinking of comparing the SavedOldValues with the saved values to locate the actual object.
I notcied that e.Item.DataItem is null in UpdateCommand event, but not in ItemDataBound event. Is there any way we can access the custom object the row being updated is bound to?
Thanks in advance,