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.
Unfortunately, activation email could not send to your email. Please try again.

BeginUpdate throws null pointer exception on GUI Thread

Thread ID:

Created:

Updated:

Platform:

Replies:

53697 Dec 19,2006 04:43 AM Dec 21,2006 11:12 AM Windows Forms 3
loading
Tags: Grouping
David Vanstone
Asked On December 19, 2006 04:43 AM

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

Administrator [Syncfusion]
Replied On December 20, 2006 07:11 AM

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

David Vanstone
Replied On December 20, 2006 11:47 AM

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;
} }
...

Administrator [Syncfusion]
Replied On December 21, 2006 11:12 AM

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

CONFIRMATION

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.

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.

;