BeginUpdate throws null pointer exception on GUI Thread

Exception Source: Syncfusion.Grid.Grouping.Windows
Exception Type: System.NullReferenceException
Exception Message: Object reference not set to an instance of an object.
Exception Target Site: BeginUpdate

---- Stack Trace ----
Syncfusion.Windows.Forms.Grid.Grouping.GridGroupingControl.BeginUpdate()
Radar.exe: N 00006

3 Replies

AD Administrator Syncfusion Team December 20, 2006 12:11 PM UTC

Hi David,

Thank you for being patience.

Are you using multiple threads in your application? Is the grid is being loaded from a separate thread? Please refer to the following demo sample which demonstrates loading the data in grid using a thread. Kindly try it and let us know if you need any further assistance.

Sample : LoadingGGC_Thread.zip

Also refer to the following KB article for more details.
http://www.syncfusion.com/Support/article.aspx?id=572

Have a nice day.

Best regards,
Madhan


DV David Vanstone December 20, 2006 04:47 PM UTC

Yes the grid is being loaded from a separate thread. However I do the BeginUpdate on the GUI thread.

private void LockUpdatingGrid(bool lockGrid)
{
if (this.InvokeRequired)
{
this.Invoke(new LockUpdatingGridDelegate(LockUpdatingGrid), new object[] { lockGrid });
return;
}

try
{
if (lockGrid)
{
if (!grdActivitiesList.Table.TableDirty)
{
grdActivitiesList.BeginUpdate();
grdActivitiesList.Table.TableDirty = true;
grdActivitiesList.Table.SummariesDirty = true;
} }
...


AD Administrator Syncfusion Team December 21, 2006 04:12 PM UTC

Hi David,

Please try using grid.InvokeRequired property and grid.Invoke method. You can refer to the KB article mentioned above for more details. Kindly try it and update us a demo sample if the suggestion doesn’t helps or modify the above sample, so we would recommend a better solution.

>>>>>>>Code Snippet<<<<<<<
if (this.gridGroupingControl1.InvokeRequired)
{
this. gridGroupingControl1.Invoke(new LockUpdatingGridDelegate(LockUpdatingGrid), new object[] { lockGrid });
return;
}
>>>>>>>>>>>>><<<<<<<<<<<<<

Have a nice day.

Best regards,
Madhan

Loader.
Up arrow icon