I have got the following exception:
System.InvalidOperationException: The object is currently in use
at System.Drawing.Graphics.EndContainer(GraphicsContainer container)
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)
during my research at the internet about such exceptions I had found that this is related to GDI+ double buffering. Is there any way to prevent such exceptions in future?? or do the latest Syncfusion versions cater this situation.
I am using Syncfusion GridControl 1.6.x .
Are you using multiple threads? This can lead to objects in use problems if the threading is not being handled taken into account when accessing the grid object.
Are you using 220.127.116.11 or something earlier? Searching our Direct Trac incidents shows one occurrence of a similar exception, but that was more that a year ago before 18.104.22.168 was released.
You might want to try the 22.214.171.124 release. If you can send me a sample that reproduces the problem, I can try it here.
MAMaqsood AhmedOctober 6, 2004 04:12 AM UTC
I tried to reproduce this exception but it didn''t show up again. As for the multiple threading issue, I am doing all grid updates in the UI thread (using Invoke) so i think it is out of question. I am using 126.96.36.199.
AdministratorOctober 6, 2004 05:09 AM UTC
So just to confirm, before accessing the grid, you are calling grid.InvokeRequired to make sure you are on the grid''s thread.
If you run your application on a multi-processor system, do the problems show up much more quickly? If so, this might be an indication that threading is playing a role in the problem.
Unless you can send a sample, the best suggestion I have is to try your code with the latest release.