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
342
Delete Occurs but then gives 'Requested record cannot be found by key'
posted

Hi I have a WebHierarchicalDataGrid with parent-child rows.  I want the user to select a row and press a delete button outside of the grid to delete the selected row.  Sounds simple.  I implemented a javascript function to delete the selected row.  It deletes it but right after the delete it gives this error:

Microsoft JScript runtime error: Sys.WebForms.PageRequestManagerServerErrorException: Requested record cannot be found by key.

The error comes fromt he ScriptResource.axd? and is stopped at "throw error;" in the code below:

 

 

 

 

 

 

 

 

_endPostBack:

 

function PageRequestManager$_endPostBack(error, executor, data) {

 

 

 

if (this._request === executor.get_webRequest()) {

 

 

 

this._processingRequest = false;

 

 

 

this._additionalInput = null;

 

 

 

this._request = null;

}

 

 

 

var eventArgs = new

Sys.WebForms.EndRequestEventArgs(error, data ? data.dataItems : {}, executor);

Sys.Observer.raiseEvent(

 

this, "endRequest", eventArgs);

 

 

 

if (error && !eventArgs.get_errorHandled()) {

 

 

 

throw error;

Again, it actually deletes the row but afterwards posts the error above.

If I hit the 'Delete' key on my keyboard to delete a row it works without error.

Also, my delete stored procedure that is called on a delete, will delete both records in the parent table and child tables.

Any help would be appreciated.  thanks!

klp0

Parents
No Data
Reply
  • 125
    Offline posted

    Try turnibg off AutoCRUD.  I have had a similar problem and it appears that if AutoCRUD is true then the control tries to delete before or after your delete.

     

Children