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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Object Error in OnPaint

Thread ID:





21593 Nov 15,2004 05:37 PM UTC Nov 16,2004 12:11 PM UTC WinForms 2
Tags: GridControl
Chris Thompson
Asked On November 15, 2004 05:37 PM UTC

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?

Administrator [Syncfusion]
Replied On November 15, 2004 09:16 PM UTC

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?

Chris Thompson
Replied On November 16, 2004 12:11 PM UTC

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


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon