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

using GridList in user Control

I''m having a problem using the gridList in a user control. I adapted a very similar example to the grid List example with the states and images provided in the Grid list. It throws this exception: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Windows.Forms.Grid.GridControlBase.OnPaint(PaintEventArgs pe) at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer, Boolean disposeEventArgs) at System.Windows.Forms.Control.WmPaint(Message& m) at System.Windows.Forms.Control.WndProc(Message& m) at Syncfusion.Windows.Forms.ScrollControl.WndProc(Message& msg) at Syncfusion.Windows.Forms.Grid.GridControlBase.WndProc(Message& msg) at System.Windows.Forms.ControlNativeWindow.OnMessage(Message& m) at System.Windows.Forms.ControlNativeWindow.WndProc(Message& m) at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam) Is there an easy fix that I''m not seeing?

1 Reply

AD Administrator Syncfusion Team October 7, 2005 09:55 PM UTC

Are you trying to use multuple threads? If so, you need to make sure you do gridListControl.InvokeRequired checks before you try to access any GridListControl methods. Here is a KB link for the GridControl. It will be similar for a GridListControl (or any other Control derived class.) http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=78 If it is not a threading issue, then if you can upload a little sample showing the problem, we can try to debug it here.

Loader.
Live Chat Icon For mobile
Up arrow icon