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
265
WebDataGrid cell validation on Row Adding and Row Editting NullReferenceException
posted

Hello,

I am using version 14.1.20141.2150 of the WebDataGrid. On my grid I have both row editing and row adding. I have four asp.net validation controls attached to four of the editor controls. This validation is only on row adding (This is because the respective fields are read only on row editing.)

Editor Providers:

<EditorProviders>

<ig:TextEditorProvider ID="tepFirstName">

<EditorControl ClientIDMode="Predictable"/>

</ig:TextEditorProvider>

<ig:TextEditorProvider ID="tepLastName">

<EditorControl ClientIDMode="Predictable"/>

</ig:TextEditorProvider>

<ig:TextEditorProvider ID="tepEmail">

<EditorControl ClientIDMode="Predictable"/>

</ig:TextEditorProvider>

<ig:MaskEditorProvider ID="mepPhone">

<EditorControl ID="ecPhone" ClientIDMode="Predictable" BorderStyle="None" InputMask="(###) ###-#### Ext. 99999"></EditorControl>

</ig:MaskEditorProvider>

<ig:TextEditorProvider ID="tepPhone">

<EditorControl ClientIDMode="Predictable"/>

</ig:TextEditorProvider>

</EditorProviders>

Row Adding Column Settings:

<ig:RowAddingColumnSetting ColumnKey="FirstName" ReadOnly="False" EditorID="tepFirstName" ValidatorID="valFirstNameRequired"/>

<ig:RowAddingColumnSetting ColumnKey="LastName" ReadOnly="False" EditorID="tepLastName" ValidatorID="valLastNameRequired"/>

<ig:RowAddingColumnSetting ColumnKey="Position" ReadOnly="False" />

<ig:RowAddingColumnSetting ColumnKey="EmailAddress" ReadOnly="False" EditorID="tepEmail" ValidatorID="cvEmail"/>

<ig:RowAddingColumnSetting ColumnKey="Phone" ReadOnly="False" EditorID="mepPhone" ValidatorID="cvPhone" />

Asp Validators:

<asp:RequiredFieldValidator runat="server" ID="valFirstNameRequired" ControlToValidate="wdgContacts" ForeColor="" CssClass="igg_NavisphereValidationErrorMessage" />

<asp:RequiredFieldValidator runat="server" ID="valLastNameRequired" ControlToValidate="wdgContacts" ForeColor="" CssClass="igg_NavisphereValidationErrorMessage" />

<asp:CustomValidator runat="server" ID="cvEmail" ControlToValidate="wdgContacts" CssClass="igg_NavisphereValidationErrorMessage" ClientValidationFunction="wdgContacts_cvEmail" />

<asp:CustomValidator runat="server" ID="cvPhone" ControlToValidate="wdgContacts" CssClass="igg_NavisphereValidationErrorMessage" ClientValidationFunction="wdgContacts_cvPhone"/>

The validation on row adding works correctly on the clientside but as soon as I click the save button to execute the post back it returns an "Object reference not set to an instance of an object." error occurs. The NullReferenceException appears to occur on the "ColumnEditSettings" Infragistics file at line 207. (Full File Path: Source\Infragistics.Web.UI\GridControls\WebDataGrid\Behaviors\EditableBehaviorBase\ColumnEditSetting.cs:207 )

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
   Infragistics.Web.UI.GridControls.ColumnEditSetting.SaveClientProperties() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\GridControls\WebDataGrid\Behaviors\EditableBehaviorBase\ColumnEditSetting.cs:207
   Infragistics.Web.UI.GridControls.RowAddingColumnSetting.SaveClientProperties() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\GridControls\WebDataGrid\Behaviors\Editing\RowAdding\RowAddingColumnSetting.cs:123
   Infragistics.Web.UI.Framework.ObjectBase.Infragistics.Web.UI.IClientState.SaveClientProperties() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:654
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientCollections(StringBuilder builder, ArrayList collections) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:870
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientState(StringBuilder builder) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:814
   Infragistics.Web.UI.Framework.ObjectBase.Infragistics.Web.UI.IClientState.WriteClientState(StringBuilder builder) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:669
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientObjects(StringBuilder builder, ArrayList objects) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:839
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientState(StringBuilder builder) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:806
   Infragistics.Web.UI.Framework.ObjectBase.Infragistics.Web.UI.IClientState.WriteClientState(StringBuilder builder) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:669
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientObjects(StringBuilder builder, ArrayList objects) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:839
   Infragistics.Web.UI.Framework.ObjectBase.WriteClientState(StringBuilder builder) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\ObjectBase.cs:806
   Infragistics.Web.UI.Framework.RunBot.PopulateScriptDescriptor(ScriptBehaviorDescriptor descriptor) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\RunBot.cs:290
   Infragistics.Web.UI.GridControls.GridBot.PopulateScriptDescriptor(ScriptBehaviorDescriptor descriptor) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\GridControls\WebDataGrid\GridBot.cs:68
   Infragistics.Web.UI.Framework.Data.<GetScriptDescriptors>d__0.MoveNext() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\Data\FlatDataBoundControl.cs:1109
   System.Web.UI.ScriptControlManager.RegisterScriptsForScriptDescriptors(IEnumerable`1 scriptDescriptors, Control control) +63
   System.Web.UI.ScriptControlManager.RegisterScriptDescriptors(IScriptControl scriptControl) +140
   Infragistics.Web.UI.Framework.RunBot.RegisterScriptDescriptors() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\RunBot.cs:421
   Infragistics.Web.UI.GridControls.GridBot.RegisterScriptDescriptors() in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\GridControls\WebDataGrid\GridBot.cs:646
   Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.Render(HtmlTextWriter writer) in e:\work\3\559\src\RELEASE\ASP.NET\2014.1\Source\Infragistics.Web.UI\Framework\Data\FlatDataBoundControl.cs:647
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   ASP.tasks_carrier_maintaincarriercontacts_aspx.__RenderContent1(HtmlTextWriter __w, Control parameterContainer) in C:\Workspaces\eComm\Navisphere\DEV\BidManagement.WebUI\Tasks\Carrier\MaintainCarrierContacts.aspx:77
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +268
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +216
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Control.Render(HtmlTextWriter writer) +10
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +128
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +57
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1386

Notes:


I was not able to create a basic example replicating this issue. There appears to be something wrong with the validator logic to hook the grid editor back up with the validator on postback/page render.


Questions:

What appears to be the issue here? Am I missing some attributes on my editors or validators that is causing the null exception?

Things I have tried:


I have tried adding the validators to the CellEditting ColumnSettings fields as well, in case it was throwing an error because it could no longer find the linked validators. This did not work.

Has anyone else had this issue and know what is causing it?

Thanks,

Mason

Parents Reply Children
No Data