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.

Exception at the time of refreshing grid.

Thread ID:

Created:

Updated:

Platform:

Replies:

54050 Dec 28,2006 07:43 AM Dec 28,2006 11:17 PM Windows Forms 1
loading
Tags: GridControl
Ravi
Asked On December 28, 2006 07:43 AM

Hi syncfusion team,

Iam using a syncfusion grid which will be auto refreshed periodically based on timer the event. Iam getting following exception after refreshing the grid some 'N' number of times. I believe the exception occurs because multiple threads are accessing the dataset at the same time. But I don't know how to fix the problem, can you please help me to figure out the problem.

Exception: System.NullReferenceException
Message: Object reference not set to an instance of an object.
Source: System.Data
at System.Data.Index.CompareRecords(Int32 record1, Int32 record2)
at System.Data.Index.IndexTree.CompareNode(Int32 record1, Int32 record2)
at System.Data.RBTree`1.RBInsert(Int32 root_id, Int32 x_id, Int32 position)
at System.Data.Index.InsertRecord(Int32 record, Boolean fireEvent)
at System.Data.Index.ApplyChangeAction(Int32 record, Int32 action)
at System.Data.DataTable.RecordStateChanged(Int32 record1, DataViewRowState oldState1, DataViewRowState newState1, Int32 record2, DataViewRowState oldState2, DataViewRowState newState2)
at System.Data.DataTable.SetNewRecordWorker(DataRow row, Int32 proposedRecord, DataRowAction action, Boolean isInMerge, Int32 position, Boolean fireEvent, Exception& deferredException)
at System.Data.DataTable.InsertRow(DataRow row, Int32 proposedID, Int32 pos, Boolean fireEvent)
at System.Data.DataRowCollection.Add(DataRow row)

NOTE: since it is a .NET Remoting application, and the grid populates the data from the database. The grid populates the latest data (other user can edit and save the data in the grid) from the database correctly most of the times and it throws above exception 1 in 50 times.

Regards,
-Ravi.

Administrator [Syncfusion]
Replied On December 28, 2006 11:17 PM

Hi Ravi,

Anytime you try to access a method on one of the grids, are you checking grid.InvokeRequired to see if you need to invoke a delagate call on theh grid's thread to make sure you access teh grid on the proper thread?

Not doing this will cause problems such as you described. Here is a kb link discussing using threads. http://www.syncfusion.com/Support/article.aspx?id=572

If this is not what you are seeing, then if you can upload a sample project showing this problem, we can debug it here to see what might be going on.

Best Regards,
Haneef

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.

;