I have a webdatatree control based on which the data for my webhierarchicaldatagrid is bound with.
Say I made some changes in the grid and without submitting the page I click on another node of the tree I need to confirm with the user for the unsaved changes and if the user opts to undo the changes, I get the following error.
Exception Type: Infragistics.Web.UI.GridControls.MissingRecordException
Message:
========
Requested record cannot be found by key.
Stack Trace:
============
at Infragistics.Web.UI.GridControls.EditingCore.OnAction(String actionType, Object id, Object value, Object tag)
at Infragistics.Web.UI.GridControls.GridBehavior.Infragistics.Web.UI.GridControls.IGridBehavior.OnAction(String actionType, Object id, Object value, Object tag)
at Infragistics.Web.UI.GridControls.GridBot.LoadAdditionalClientState(Object state)
at Infragistics.Web.UI.GridControls.ContainerGridBot.LoadAdditionalClientState(Object state)
at Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent()
at Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent()
at Infragistics.Web.UI.GridControls.ContainerGrid.RaisePostDataChangedEvent()
at System.Web.UI.Page.RaiseChangedEvents()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)InnerException 1
My code
Sys.Application.add_init(application_init);
function application_init() { var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(prm_initializeRequest);}
function application_init() {
var prm = Sys.WebForms.PageRequestManager.getInstance(); prm.add_initializeRequest(prm_initializeRequest);}
function prm_initializeRequest(sender, args) { try { //var tree = $find("<%= wdtTree.ClientID %>"); var grid = $find("<%= whdgGrid.ClientID %>"); var hasChanges = false; if (grid != null) { if (grid.get_gridView()._actionList._count > 0) { hasChanges = true; } } if (sender._postBackSettings.sourceElement.id == "<%= wdtTree.ClientID %>" && hasChanges==true) { grid.get_gridView().get_behaviors().get_editingCore().clearBatchUpdates(); //grid.get_gridView()._actionList.clear(); } else if (sender._postBackSettings.sourceElement.id != '<%= btnSubmit.ClientID %>' && hasChanges ==true) { var submitChanges = confirm("Well allocation data has been modified do you want to review and save the changes?"); if (!submitChanges) grid.get_gridView().get_behaviors().get_editingCore().clearBatchUpdates(); else { alert("Please click on submit button to save changes."); args.set_cancel(true); } } } catch (e) {} }
thanks
Hello Lily,
Thank you for posting in our community. There are forum threads regarding this issue. Please visit the following links:http://blogs.infragistics.com/forums/t/51608.aspx
http://forums.infragistics.com/forums/p/61688/312347.aspx
http://community.infragistics.com/forums/t/47648.aspx
http://news.infragistics.com/forums/t/58797.aspx
http://news.infragistics.com/forums/p/65467/331717.aspx
http://news.infragistics.com/forums/p/65291/330871.aspx
http://blogs.infragistics.com/forums/p/63501/321876.aspx#321876
http://blogs.infragistics.com/forums/p/62962/318870.aspx
From the small code snippets I could not determine where the issue comes from. I will need more detailed information like what is your datasource. What are your update/delete querries WHDG mark up.
Hello Lily,Please let me know what is your progress with this issue. Did you manage to resolve it?