I've a bug in some old code. The Exception occurs infrequent, when calling PerformAutoSize of a UltraGridRow. Maybe this is a multi threading issue: The method calling PerformAutoSize is triggered by the ListChanged event of the DataView.
System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Win.UltraWinGrid.UltraGridColumn.GetCachedCellAppearance(Boolean selected, AppearanceData& appData, ResolveAppearanceContext& context) at Infragistics.Win.UltraWinGrid.UltraGridRow.ResolveCellAppearance(UltraGridColumn column, AppearanceData& appData, AppearancePropFlags& requestedProps, Boolean cellAppearanceOnly, Boolean forceSelected, ForceActive forceActive, Boolean isMergedCell, Boolean hotTrackingCell, Boolean hotTrackingRow, Boolean isProxyResolution) at Infragistics.Win.UltraWinGrid.UltraGridLayout.ResolvedCachedCellAppearance(UltraGridRow row, UltraGridColumn column, AppearanceData& appData, AppearancePropFlags& flags, Boolean hotTrackingCell, Boolean hotTrackingRow) at Infragistics.Win.UltraWinGrid.GridEmbeddableEditorOwnerInfoBase.ResolveAppearance(Object ownerContext, AppearanceData& appearance, AppearancePropFlags& requestedProps, EmbeddableEditorArea area, Boolean hotTracking, String customArea, Boolean isProxyResolution) at Infragistics.Win.UltraWinGrid.GridEmbeddableEditorOwnerInfoBase.ResolveAppearance(Object ownerContext, AppearanceData& appearance, AppearancePropFlags& requestedProps, EmbeddableEditorArea area, Boolean hotTracking, String customArea) 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.RowAutoSizeLayoutManagerHolder.CellLayoutItem.get_PreferredSize() at Infragistics.Win.Layout.GridBagLayoutManager.GetItemSizeHelper(ILayoutItem item, Boolean minimum) at Infragistics.Win.Layout.GridBagLayoutManager.CalculateGridBagLayout() at Infragistics.Win.Layout.GridBagLayoutManager.GetGridBagLayoutCache() at Infragistics.Win.Layout.GridBagLayoutManager.get_ColumnWidths() at Infragistics.Win.UltraWinGrid.RowAutoSizeLayoutManagerHolder.VerifyCachedLayoutManager() at Infragistics.Win.UltraWinGrid.UltraGridRow.CalculateAutoHeight() at Infragistics.Win.UltraWinGrid.UltraGridRow.PerformAutoSize()
Hi,
I added a Form.Invoke to the method in question.
However, I can't tell if this resolves the issue until we tested it on the staging environment (I can't reproduce the error on my machine). This might take a few weeks.
Thanks for your help, I will update this post a soon as I know more.
Hi again,
Have you been able to resolve your issue with multithreading. Please keep u sin touch.
Regards
Since you mentioned multithreading, yes, that is most likely the problem. The grid is not thread safe (almost no Windows Forms controls are), so you have to properly mashal calls to the grid across thread boundaries. There are several articles in our knowledge base on this subject; for example this one: HOWTO:WinGrid: Working With Threads.