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

GDI Objects reaching limit of 10000

Thread ID:





101953 Dec 8,2011 05:48 PM UTC Dec 22,2011 05:56 AM UTC WinForms 5
Tags: Grouping
Asked On December 8, 2011 05:48 PM UTC


We are setting the text in the QueryCellStyleInfo event on our gridgroupingcontrol. When we do this and start scrolling around the grid we eventually get an out of memory exception. What we can see going on is when we set the text using property GridTableCellStyleInfo.Text and scroll around on the grid the number of GDI objects keeps increasing until the 10000 limit is hit and an out of memory exception is thrown. The GDI objects never seem to be released. Is there a way to keep this from happening?


Ragamathulla B [Syncfusion]
Replied On December 10, 2011 05:19 AM UTC

Hi Sean,

Thank you for your interest in syncfusion products,

1) I Would request you to please provide your version details.
2) And also am afraid to reproduce your reported issue so please provide more details and sample regarding your issue. Thanks for aditional information.

Please let me know if you have any further concerns.

Ragamathullah B.

Replied On December 19, 2011 02:00 PM UTC

The version is

I now think it has more to do with setting the font size or color. I have modified one of the demo's to show what is happening. Once running just keep scrolling up and down and watch the gdi object grow on a Win7 machine. Once the 10000 limit is reached an out of memory error is thrown.

We are adding custom sections on the grid and setting the text and font size and color in QueryCellStyleInfo.


Ragamathulla B [Syncfusion]
Replied On December 20, 2011 12:48 AM UTC

Hi Sean,

Thanks for the update.

The QueryCellInfo is trigger every time so i would request you to please use PrepareViewStyleInfo instead of QueryCellInfo. The following code explains the same.

gridGroupingControl1.TableControl.PrepareViewStyleInfo += new GridPrepareViewStyleInfoEventHandler(TableControl_PrepareViewStyleInfo);

void TableControl_PrepareViewStyleInfo(object sender, GridPrepareViewStyleInfoEventArgs e)

Please let me know if you have any further concerns.

Ragamathullah B.

Replied On December 20, 2011 03:11 PM UTC


If we run into any more issues I will consider making that change. I managed to solve this by a recommendation in a previous post on the forums.

Ended up going with adding new base styles and using those in when setting the font properties in query cell style info method. Seems to have solved the issue.

Using this during grid intialization:

gridGroupingControl.BaseStyles["BoldStyle"].StyleInfo.Font.Bold = true;
gridGroupingControl.BaseStyles["BoldStyle"].StyleInfo.Font.Size = 7;

Then in querycellstyleinfo assigning the new style:

eStyle.BaseStyle = "BoldStyle";

Thanks again!

Ragamathulla B [Syncfusion]
Replied On December 22, 2011 05:56 AM UTC

Hi Sean,

Please let me know if you have any concern.

Ragamathullah B.


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