We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. (Last updated on: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

[NullReferenceException: Object reference not set to an instance of an object.]

Thread ID:





69344 Oct 24,2007 07:34 PM UTC Oct 31,2007 08:03 AM UTC ASP.NET Web Forms (Classic) 1
Tags: Grouping
mahesh mohite
Asked On October 24, 2007 07:34 PM UTC


I have a grid that binds a datasource. Now that the number of columns in the datasource are changed when the grid loads, I get above error. Please see the following stack trace

[NullReferenceException: Object reference not set to an instance of an object.]
Syncfusion.Web.UI.WebControls.Grid.Grouping.Utils.GetRecordId(Record r)
Syncfusion.Web.UI.WebControls.Grid.Grouping.Utils.GetTableElementKey(Object tableElement)
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridRow..ctor(Element e, GridTable gTable, GridGroupingControl parent, Int32 eIndex)
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.CreateRowFromDisplayElement(Element e, Int32 rowIndex, GridTable gTable)
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.RenderVisiblePage(Table table, GridTable gTable, ChildTable cTable, PageInfo pi, GridPageInfo gpi, Boolean currentRecordFound)
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.InitHtmlTableFromGridTable(Table table, GridTable gTable, ChildTable cTable, Int32 curPage, Int32 pageSize)
Syncfusion.Web.UI.WebControls.Grid.Grouping.GridGroupingControl.OnPreRender(EventArgs e)

Any suggestions/comments would appreciated

Melba Winshia [Syncfusion]
Replied On October 31, 2007 08:03 AM UTC

Hi Mahesh,

We regret for the delayed response.

Normally if a grid is bound with datasource and then you are changing the columns in the datasource, you should rebind the datasource to grid by using the below code snippet:


this.gridGroupingControl1.DataSource = null;
this.gridGroupingControl1.DataMember = null;
this.gridGroupingControl1.DataSource = newdatasource;

Please refer the sample in the below link which illustrates the above:


Please have a look at the above sample and if still the issue exists, could you please try reproducing it in the above sample and send us the modified sample so that we could sort out the cause of the issue and provide you a solution?



This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon