Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
365
NullReferenceException when resizing the rows
posted

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()