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

GDI Objects reaching limit of 10000

Thread ID:

Created:

Updated:

Platform:

Replies:

101953 Dec 8,2011 05:48 PM UTC Dec 22,2011 05:56 AM UTC Windows Forms 5
loading
Tags: Grouping
sean
Asked On December 8, 2011 05:48 PM UTC

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!


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.

Regards,
Ragamathullah B.


sean
Replied On 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

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)
{
//code
}

Please let me know if you have any further concerns.

Regards,
Ragamathullah B.


sean
Replied On 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


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

Hi Sean,

Please let me know if you have any concern.

Regards,
Ragamathullah B.


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

;