Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
540
Requested record cannot be found by key
posted

Hi,

I have bound the data to the web data grid. The grid has checkbox and dropdown columns. When I update the record in the grid and try to save, I recieve the below error message. Kindly let me know on how to fix the issue.

Requested record cannot be found by key.
Common Causes:
- The data key field(s) is being edited causing the record not to be found when trying to update.
- Not rebinding the grid when there are updates to be committed (assuming DataViewState is disabled in this case) – for instance if the grid is bound on !IsPostback.
- While a user is editing a particular row in the grid, another user deletes the record from the database. On posting back, the grid is rebound to the updated datasource which no longer contains the record, resulting in the exception.
- Changing completely or filtering the grid’s datasource before all CRUD operations are carried out – this is quite common when using other controls on the page to do this . This is partly due to the fact that control events such as SelectedIndexChanged for a dropdownlist or Click for a button fire before the updating events. Changing the grid’s source should in such cases be delayed for later (PreRender).

Parents Reply Children