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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Huge problem: Dangerous increase of GDI objects when using virtual grid

Thread ID:

Created:

Updated:

Platform:

Replies:

58271 Mar 21,2007 02:27 PM UTC Mar 22,2007 02:52 PM UTC WinForms 4
loading
Tags: GridControl
Ivan Capin
Asked On March 21, 2007 02:27 PM UTC

Hi,

Run the traderGridTest example and monitor the GDI objects used by this application in the Windows Task Manager.
Keep on resizing the traderGridTest window: nothing happens

Now, add the simple line between arrows below, in m_syncGrid_QueryCellInfo:

...
// Retrieve the cell value
object[] row = (object[]) m_set[e.RowIndex-1];
e.Style.CellValue = row[e.ColIndex-1];
-----> e.Style.Font.Bold = true; <-------
e.Handled = true;
...

Run and keep on resizing... The GDI objects rises continuously and if it reaches 10000 the application craches.

Any ideas how to keep the GDI number low ?
My guess is that resizes trigger updates that trigger ResetVolatileData but I don't know how to resolve my problem.

Thank you for your help.

Administrator [Syncfusion]
Replied On March 21, 2007 09:04 PM UTC

Hi Ivan,

Please refer to the RefreshGrid ( \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\PerformanceSamples\RefreshGrid\cs ) browser sample that caches the graphics object across paint calls and disposes it only when the grid gets disposed or its size was changed. It also implements a GDI or a GDI+ to manage the drawing of texts and backgrounds. In some situations, it would be more efficient to use a GDI drawing. This is implemented by the derived grid in the OnDrawCellDisplayText and the OnFillRectangleHook overrides. It uses a call to static helper methods in the library code that access the GDI routines through the interop.

Best regards,
Haneef

Ivan Capin
Replied On March 22, 2007 10:23 AM UTC

Hello Haneef,

I am sorry but I am not very pleased by this answer. We have bought 4 Syncfusion licences and we have already developed a quite important application that includes virtual grids and that is used by traders on a daily basis. We are not going to drop our virtual grids just because it is not possible to display BOLD caracters on it (the example I gave is blatant) !!!
Please try to cater a satisfactory answer or the details of someone that can.
I am sorry to be that harsh but we have an application with a bug coming from your code and we absolutly need a solution.

Regards

>Hi Ivan,

Please refer to the RefreshGrid ( \Syncfusion\Essential Studio\4.4.0.49\windows\Grid.Windows\Samples\PerformanceSamples\RefreshGrid\cs ) browser sample that caches the graphics object across paint calls and disposes it only when the grid gets disposed or its size was changed. It also implements a GDI or a GDI+ to manage the drawing of texts and backgrounds. In some situations, it would be more efficient to use a GDI drawing. This is implemented by the derived grid in the OnDrawCellDisplayText and the OnFillRectangleHook overrides. It uses a call to static helper methods in the library code that access the GDI routines through the interop.

Best regards,
Haneef

Administrator [Syncfusion]
Replied On March 22, 2007 01:34 PM UTC

Hi Ivan,

Please refer this KB article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=352

Best regards,
Haneef

Ivan Capin
Replied On March 22, 2007 02:52 PM UTC

That's perfect, it works. Thank you very much Haneef.

>Hi Ivan,

Please refer this KB article for more details.
http://www.syncfusion.com/support/kb/grid/Default.aspx?ToDo=view&questId=352

Best regards,
Haneef

CONFIRMATION

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.

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

;