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

GDI Objects reaching limit of 10000

Hi,

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?

Thanks!


5 Replies

RB Ragamathulla B Syncfusion Team 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.

Regards,
Ragamathullah B.



SE sean December 19, 2011 02:00 PM UTC

The version is 8.3.0.21.

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.



CS_c1d80700.rar


RB Ragamathulla B Syncfusion Team 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)
{
//code
}

Please let me know if you have any further concerns.

Regards,
Ragamathullah B.



SE sean December 20, 2011 03:11 PM UTC

Thanks!

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.Add("BoldStyle");
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!
Sean



RB Ragamathulla B Syncfusion Team December 22, 2011 05:56 AM UTC

Hi Sean,

Please let me know if you have any concern.

Regards,
Ragamathullah B.


Loader.
Live Chat Icon For mobile
Up arrow icon