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. Image for the cookie policy date
close icon

Exception at the time of refreshing grid.

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.

1 Reply

AD Administrator Syncfusion Team December 29, 2006 04:17 AM UTC

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

Loader.
Live Chat Icon For mobile
Up arrow icon