I have a grid that I update manually. The datasource is a datatable that I load in code. There are other events on the page that do not create an update, but do cause the grid to bind with new data. If I have not changed anything in the Grid this works fine. However if I have modified something the postback causes the following
[MissingRecordException: Requested record cannot be found by key.]
Infragistics.Web.UI.GridControls.EditingCore.OnAction(String actionType, Object id, Object value, Object tag) +12822 Infragistics.Web.UI.GridControls.GridBehavior.Infragistics.Web.UI.GridControls.IGridBehavior.OnAction(String actionType, Object id, Object value, Object tag) +19 Infragistics.Web.UI.GridControls.GridBot.LoadAdditionalClientState(Object state) +864 Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +99 Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent() +41 Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +16 System.Web.UI.Page.RaiseChangedEvents() +132 System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1644
AutoCRUD is set to false
EnableDataViewState = true
EnableViewState = true
Can anyone help with this? If AutoCRUD is set to false, what is the EditingCore.OnAction firing for?
Hello,
You could try binding only on the first page load and if you will change the data source, do this on PreRender. And using ClearDataSource method should be fine. Also, I would suggest you to use the latest service release for 12.1/12.2 as there is a known issue with clearing the data source when EnableDataViewState is set to true, which is resolved now.
No this is not resolved. Yes - I can turn viewstate off and I don't get the error, however I use the viewstate to persist information in the grid, so I can't just turn it off in my application. Why shouldn't this work with viewstate turned on?
I'm just checking if you managed to resolve your issue.
Hi,
You could also try to disable grid's Viewstate by setting its EnableViewState property to false. Try to set EnableDataViewState property to false as well.
I tried it with our without that and get the same thing