This is a migrated thread and some comments may be shown as answers.

GDI+ Error in System.Drawing.Graphics.MeasureString

9 Answers 688 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
Sudi
Top achievements
Rank 1
Sudi asked on 27 Oct 2014, 09:15 PM
My application populates a combobox with 3000+ items. When I select all the items in the list, I get the following error on postback of the page.

Is there a limit on the maximum number of items/characters I can display in the combobox?

[ExternalException (0x80004005): A generic error occurred in GDI+.]
System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat) +1593640
System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea) +18
System.Drawing.Graphics.MeasureString(String text, Font font) +43
Telerik.Web.UI.RadComboBox.MeasureCheckedItemsText(String checkedItemsTexts) +188
Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e) +421
System.Web.UI.Control.PreRenderRecursiveInternal() +113
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Control.PreRenderRecursiveInternal() +222
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +4297


9 Answers, 1 is accepted

Sort by
0
Peter Filipov
Telerik team
answered on 30 Oct 2014, 08:15 AM
Hello Sudi,

I have tested the described scenario and everything is working fine. Please test the attached project and try to modify it in order to reproduce the problem.

Regards,
Peter Filipov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Rimon Erez
Top achievements
Rank 1
answered on 30 Oct 2014, 02:16 PM
Hi Peter,

We modified your project to handle the exact data that our application binds to the dropdown. Unfortunately, we can't replicate the error this way. 

Are there any other reasons why the control could be exceeding the max GDI+ handles limit?
0
Peter Filipov
Telerik team
answered on 31 Oct 2014, 09:13 AM
Hello Rimon,

We are not aware of such issue, that's why I have requested for a modification on the sample. Pleas let me know if you find out how to reproduce it. 

Regards,
Peter Filipov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Vivek
Top achievements
Rank 1
answered on 01 Apr 2015, 11:44 AM
Hello All,

I am also getting the below error on my application page where Stored Procedure is returning around 3500 records.

System.Runtime.InteropServices.ExternalException: A generic error occurred in GDI+.   
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)    
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea)    
at System.Drawing.Graphics.MeasureString(String text, Font font)    
at Telerik.Web.UI.RadComboBox.MeasureCheckedItemsText(String checkedItemsTexts)    
at Telerik.Web.UI.RadComboBox.OnPreRender(EventArgs e)    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()   
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal()    
at System.Web.UI.Control.PreRenderRecursiveInternal() 

But if I am altering the stored Proc to return top 3000 records it's working fine.

Could anyone please help me on this?

Regards,
Vivek
0
Peter Filipov
Telerik team
answered on 03 Apr 2015, 10:24 AM
Hi Vivek,

Could you test your project with Q1.2015. The measuring algorithm of the checked items is changed and that issue should not appear.

Regards,
Peter Filipov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Vivek
Top achievements
Rank 1
answered on 07 Apr 2015, 10:07 AM

Hi Peter,

Thanks for the update...

Could you please let me know from where I can download the Telerik.Web.UI.dll for Q1.2015 and also could you please let me know if updating this will impact the existing UI?

Regards,

Vivek

0
Peter Filipov
Telerik team
answered on 07 Apr 2015, 11:41 AM
Hello Vivek,

You need to log into your profile and download it from there(look for SP Q1 2015). There should be no major differences in the appearance.

Regards,
Peter Filipov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
Vivek
Top achievements
Rank 1
answered on 07 Apr 2015, 12:36 PM

Thanks Peter...

 One more query before proceeding with download of SP Q1 2015 that currently we are using the Telerik.Web.UI.dll with attached details so there will be no impact and no major changes if i will upgrade this from Q1 2015.

 

Regards,

Vivek

0
Peter Filipov
Telerik team
answered on 08 Apr 2015, 08:39 AM
Hi Videk,

In the ticket info it is pointed that your are using Q3 2014. That's why I have suggested you to update. 
For case it is 4 years difference and we have done many improvements and bug fixes in our code, so it is possible to have some differences in your app which must be repaired. My suggestion is to update as soon as you could and try to stick to the latest versions of our product in order to avoid big migrations as this in the future. The benefit will be visible since we are trying to improve out products to keep the count of the bugs to minimum.

Regards,
Peter Filipov
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ComboBox
Asked by
Sudi
Top achievements
Rank 1
Answers by
Peter Filipov
Telerik team
Rimon Erez
Top achievements
Rank 1
Vivek
Top achievements
Rank 1
Share this question
or