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
375
Object reference not set to an instance of an object
posted

I'm having following problem in the WebDataGrid:

I created a small project to show you what is my problem. I have a page with a webDataGrid and a drop down list that is used to change datasource in the grid.

Changing the datasource works fine until you sort or filter by any column. Although, I'm clearing the data source on drop down change as well as clearing sorting and filtering behaviors. But I'm getting this error.

[NullReferenceException: Object reference not set to an instance of an object.]
   Infragistics.Web.UI.GridControls.Sorting.BehaviorEvents_PreRender(Object sender) +468
   Infragistics.Web.UI.GridControls.RenderingContentHandler.Invoke(Object sender) +0
   Infragistics.Web.UI.GridControls.GridBehaviorEvents.OnRenderingContent() +74
   Infragistics.Web.UI.GridControls.GridRenderer.RenderContents(HtmlTextWriter writer) +281
   Infragistics.Web.UI.Framework.RunBot.HandleRenderContents(HtmlTextWriter writer, RendererBase renderer) +135
   Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.RenderContents(HtmlTextWriter writer) +74
   Infragistics.Web.UI.Framework.Data.FlatDataBoundControl.Render(HtmlTextWriter writer) +39
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +163
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +32
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +51
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +134
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +19
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +99
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1266

 

Please see attached zip file.

Thanks

OscarG

WebApplication1.zip