If I add a row on the client side, I can see the new row appear in my grid and I am able to make changes to the values. When I click any button that posts back to the page, I receive this null reference error:
[NullReferenceException: Object reference not set to an instance of an object.]
Infragistics.Web.UI.GridControls.EditingCore.OnAction(String actionType, Object id, Object value, Object tag) +16778
Infragistics.Web.UI.GridControls.GridBehavior.Infragistics.Web.UI.GridControls.IGridBehavior.OnAction(String actionType, Object id, Object value, Object tag) +90
Infragistics.Web.UI.GridControls.GridBot.LoadAdditionalClientState(Object state) +2187
Infragistics.Web.UI.Framework.RunBot.HandleRaisePostDataChangedEvent() +340
Infragistics.Web.UI.GridControls.GridBot.HandleRaisePostDataChangedEvent() +108
Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RaisePostDataChangedEvent() +67
System.Web.UI.Page.RaiseChangedEvents() +89
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2777
On the grid I have ViewState disabled and on the Editing Core I have BathUpdating enabled. What is causing this null reference?
Here is a sample I have created for you to reproduce the error. Thank you for your help.
Hi,
The problem is in your sample. You are giving three values in the array when adding a row. However, you have only two columns, so there is a null reference exception trying to get an Item (cell) from the row on the server for the third one. This value is unnecessary. If you need a value not in the columns, you should add it in the row adding event on the server.
regards,David Young