Hi,
I'm having a problem when I delete the last item in a detail table, which causes the parent row to be deleted as well.
I get client errors saying "Parent table relations set, but no corresponding data-key name found" and "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"
The master table and the detail table are both bound at the same time during the grids NeedDataSource event. I have tried setting the HierarchyLoadMode to different values, but it didn't help.
The delete command item is on the child table. The delete happens successfully, the DataSource is set to null, the NeedDataSource event occurs, and table is given new data for both the master table and the detail table.
The error only happens when the row is the very LAST row in the grid and all the child items are deleted, causing the parent row to disappear. If it’s the first row or one of the middle rows, no error occurs. If it is the only row in the grid you receive the error "Parent table relations set, but no corresponding data-key name found". If there's more than 1 row, you get the "Index was out of range" error.
Anyone ever encounter anything like this? Any ideas for workarounds?
Thanks
-Adam