Hi
I use UltraGrid control to show data, if the data in the cell is very long,the application will randomly throw a generic error occured in gdi+, and then all the controls in my form will be a red X.
Error played only in Win 8
UltraWinGrid version :14.1.20141.2035
Could you help me?
Hi,
The big red X means that there was an exception raised during the painting of the control. Usually, the grid will show the details of the exception in addition to the X. So if you could post the call stack or a screen shot of the exception, it might help narrow down what's causing it.
Typical causes of the big red X are:
1) Threading issues - is your application using multiple threads, a background worker thread, or anything like that?
2) Images that are disposed - of you assign an image to the grid and then dispose of the image that the grid still needs, it can cause an exception.
3) Since you mention long text - how long are you talking about here? The TextBox control has a limit to how much text it will draw before it blows up. There are also limits to the amount of text you can draw in a single string using GDI or GDI+. The grid should be handling these limits and just failing to draw all of the text as opposed to crashing, but it's possible this is a case the grid is not handling.
The full stack is:EXCEPTION MESSAGE: A generic error occurred in GDI+.
EXCEPTION TYPE: System.Runtime.InteropServices.ExternalException
EXCEPTION SOURCE: System.Drawing
STACK TRACE:
at System.Drawing.Graphics.CheckErrorStatus(Int32 status)
at System.Drawing.Graphics.DrawString(String s, Font font, Brush brush, RectangleF layoutRectangle, StringFormat format)
at Infragistics.Win.DrawUtility.DrawStringHelper(Graphics gr, String text, Font font, SolidBrush brush, Rectangle bounds, StringFormat stringFormat, GdiDrawStringFlags drawStringFlags)
at Infragistics.Win.DrawUtility.DrawString(Graphics gr, String text, Font font, SolidBrush brush, RectangleF bounds, StringFormat stringFormat, GdiDrawStringFlags drawStringFlags)
at Infragistics.Win.DrawUtility.DrawStringHorizontalFlowHelper(DrawStringParameters& parameters)
at Infragistics.Win.DrawUtility.DrawStringHorizontalFlow(DrawStringParameters& parameters)
at Infragistics.Win.DrawUtility.DrawString(DrawStringParameters& parameters)
at Infragistics.Win.UIElementDrawParams.DrawStringHelper(Rectangle rectInsidePadding, String textToRender, Boolean multiline, Boolean wrapText, TextUIElementBase textElement, Size& textSize, Rectangle& textArea, Int32& charactersRendered, Int32& linesRendered, Boolean trackTextArea, Boolean trackCharactersRendered, Boolean measureOnly)
at Infragistics.Win.UIElementDrawParams.DrawStringHelper(Rectangle rectInsidePadding, String textToRender, Boolean multiline, Boolean wrapText, TextUIElementBase textElement, Size& textSize, Rectangle& textArea, Int32& charactersRendered)
at Infragistics.Win.TextUIElementBase.DrawForeground(UIElementDrawParams& drawParams)
at Infragistics.Win.UIElement.DrawElement(UIElementDrawParams& defaultDrawParams)
at Infragistics.Win.UIElement.DrawChildElements(UIElementDrawParams& drawParams)
at Infragistics.Win.UIElement.DrawHelper(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean clipText, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)
at Infragistics.Win.UIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Boolean forceDrawAsFocused, Boolean preventAlphaBlendGraphics)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize, Boolean preventAlphaBlendGraphics)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode, Size elementSize)
at Infragistics.Win.ControlUIElementBase.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.Draw(Graphics graphics, Rectangle invalidRectangle, Boolean doubleBuffer, AlphaBlendMode alphaBlendMode)
at Infragistics.Win.UltraControlBase.OnPaint(PaintEventArgs pe)
at Infragistics.Win.UltraWinGrid.UltraGrid.OnPaint(PaintEventArgs pe)
at System.Windows.Forms.Control.PaintWithErrorHandling(PaintEventArgs e, Int16 layer)
at System.Windows.Forms.Control.WmPaint(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)