I just upgraded Infragistics to 18.1 from version 14 and hoped that it would solve this bug. This bug is happening for one of our client. He has a list of Products with their description in English And Arabic. But when I click on the column in the Grid to sort it, I get this error and crashes the application.
Note that I use GDI+ for TextRenderingMode = TextRenderingMode.GDIPlus
Control: Infragistics.Win.UltraWinGrid.UltraGrid
System.Runtime.InteropServices.ExternalException (0x80004005): A generic error occurred in GDI+.
at System.Drawing.Graphics.MeasureString(String text, Font font, SizeF layoutArea, StringFormat stringFormat)
at Infragistics.Win.DrawUtility.MeasureStringHelper(Graphics gr, String text, Font font, Size layoutArea, StringFormat stringFormat, Int32& charactersFitted, Int32& linesFilled, Boolean returnElementsFitted, GdiDrawStringFlags drawStringFlags)
at Infragistics.Win.EmbeddableEditorBase.GetTextSizeOfValue(EmbeddableEditorOwnerBase owner, Object ownerContext, Boolean allowMultiline, Int32 maxWidth, Boolean isTooltip)
at Infragistics.Win.EditorWithText.InternalGetSize(EmbeddableEditorOwnerBase owner, Object ownerContext, Boolean valueOnly, Boolean full, Boolean includeBorders, Int32 maxTextWidth, Boolean allowMultiline, Boolean includeOwnerPadding, Boolean isTooltip)
at Infragistics.Win.EditorWithText.GetSize(EditorSizeInfo& sizeInfo)
at Infragistics.Win.EmbeddableEditorBase.GetSize(EmbeddableEditorOwnerBase owner, Object ownerContext, Boolean valueOnly, Boolean full, Boolean borders, Int32 maxTextWidth)
at Infragistics.Win.UltraWinGrid.RowAutoSizeLayoutManagerHolder.RowAutoSizeCalculator.GetIdealCellSize(UltraGridColumn column)
at Infragistics.Win.UltraWinGrid.UltraGridRow.CalculateAutoHeight()
at Infragistics.Win.UltraWinGrid.UltraGridRow.get_HeightIncludingPadding()
at Infragistics.Win.UltraWinGrid.UltraGridRow.get_BaseHeight()
at Infragistics.Win.UltraWinGrid.UltraGridRow.get_TotalHeight()
at Infragistics.Win.UltraWinGrid.VisibleRow.GetTotalHeight(Boolean adjustForOverlappedBorders)
at Infragistics.Win.UltraWinGrid.VisibleRow.GetTotalHeight()
at Infragistics.Win.UltraWinGrid.ViewStyleBase.OrientVisibleRowForward(VisibleRowFetchRowContext& context, VisibleRow visibleRow)
at Infragistics.Win.UltraWinGrid.ViewStyleBase.AddVisibleRow(VisibleRowFetchRowContext& context, UltraGridRow row)
at Infragistics.Win.UltraWinGrid.ViewStyleBase.CreateRowsList_FixedRowsFeature(VisibleRowFetchRowContext& context, VisibleRow parentVisibleRow, UltraGridRow firstSibling)
at Infragistics.Win.UltraWinGrid.ViewStyleBase.RecreateRowList(RowScrollRegion rsr)
at Infragistics.Win.UltraWinGrid.RowScrollRegion.GetMaxScrollPosition(Boolean scrollToFill, Boolean ignoreScrollBoundsResolved)
at Infragistics.Win.UltraWinGrid.RowScrollRegion.EnsureScrollRegionFilled(Boolean calledFromRegenerateVisibleRows)
at Infragistics.Win.UltraWinGrid.RowScrollRegion.RegenerateVisibleRows(Boolean resetScrollInfo)
at Infragistics.Win.UltraWinGrid.RowScrollRegion.WillScrollbarBeShown(ScrollbarVisibility assumeColScrollbarsVisible)
at Infragistics.Win.UltraWinGrid.ViewStyleBase.FitColumnsToWidth()
at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics(Int32 pass)
at Infragistics.Win.UltraWinGrid.BandsCollection.CalculateBandMetrics()
at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetricsHelper()
at Infragistics.Win.UltraWinGrid.ColScrollRegionsCollection.InitializeMetrics()
at Infragistics.Win.UltraWinGrid.RowScrollRegion.PositionScrollbar(Boolean resetScrollInfo)
at Infragistics.Win.UltraWinGrid.ScrollRegionBase.SetOriginAndExtent(Int32 origin, Int32 extent)
at Infragistics.Win.UltraWinGrid.RowScrollRegion.SetOriginAndExtent(Int32 origin, Int32 extent)
at Infragistics.Win.UltraWinGrid.DataAreaUIElement.ResizeRowScrollRegions()
at Infragistics.Win.UltraWinGrid.DataAreaUIElement.PositionChildElements()
at Infragistics.Win.UIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UltraWinGrid.DataAreaUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UltraWinGrid.DataAreaUIElement.set_Rect(Rectangle value)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.PositionChildElements()
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.VerifyChildElements(ControlUIElementBase controlElement, Boolean recursive)
at Infragistics.Win.UIElement.VerifyChildElements(Boolean recursive)
at Infragistics.Win.ControlUIElementBase.VerifyIfElementsChanged(Boolean verify, Boolean syncMouseEntered)
at Infragistics.Win.ControlUIElementBase.get_CurrentCursor()
at Infragistics.Win.UltraControlBase.get_Cursor()
at System.Windows.Forms.Control.WmSetCursor(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
I paste the data that can be loaded into UltraWinGrid. To test it, just load it and then sort the column please.
Hi Alex,
Using GDI should be perfectly fine, but there might be minor differences beyond our expectation that the Arabic text renders properly. I recommend running your application through some tests to ensure that everything is still in place.
Thank you. If I use GDI instead of GDI+ it will be for all the other data. Do you think it is fine? It is working for GDI!
I tested this out in a quick application and I reproduce the exception. One quick thing I tried was to toggle the rendering mode to GDI instead of GDI+
ultraGrid1.TextRenderingMode = Infragistics.Win.TextRenderingMode.GDI;
Please try this out and let me know whether it works.
I will look this over with my team to determine what causes the error and what else we can do about it.