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

Object Error in OnPaint

When I click on a certain column in a Databound grid I get an "Object reference not set to an instance of an object." error in the OnPaint event. I have no code in this event. Any clue on why this is happening?

2 Replies

AD Administrator Syncfusion Team November 15, 2004 04:16 PM

Are you using multiple threads? If so, are you protecting calls into the grid using grid.InvokeRequired checks? Threading problems can manifest themselves in errore of this nature. What kind of column is the problem column? Can you post a sample project showing the problem? Or, can you post a call stack from when the exception is thrown?


CT Chris Thompson November 16, 2004 07:11 AM

Here is the call stack. I''ll work on getting an sample together. Exception Source: Syncfusion.Grid Exception Type: System.NullReferenceException Exception Message: Object reference not set to an instance of an object. Exception Target Site: OnPaint ---- Stack Trace ---- Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(pe As PaintEventArgs) C2R.CLINSight.Win32.exe: N 00535 System.Windows.Forms.Control.PaintWithErrorHandling(e As PaintEventArgs, layer As Int16, disposeEventArgs As Boolean) C2R.CLINSight.Win32.exe: N 00196 System.Windows.Forms.Control.WmPaint(m As Message&) C2R.CLINSight.Win32.exe: N 00500 System.Windows.Forms.Control.WndProc(m As Message&) C2R.CLINSight.Win32.exe: N 00656 Syncfusion.Windows.Forms.ScrollControl.WndProc(msg As Message&) C2R.CLINSight.Win32.exe: N 00517 Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(msg As Message&) C2R.CLINSight.Win32.exe: N 00306 System.Windows.Forms.ControlNativeWindow.OnMessage(m As Message&) C2R.CLINSight.Win32.exe: N 00010 System.Windows.Forms.ControlNativeWindow.WndProc(m As Message&) C2R.CLINSight.Win32.exe: N 00187 System.Windows.Forms.NativeWindow.Callback(hWnd As IntPtr, msg As Int32, wparam As IntPtr, lparam As IntPtr) C2R.CLINSight.Win32.exe: N 00047

Loader.
Live Chat Icon For mobile
Up arrow icon