To replicate the issue, run the attached sample project and drag the Type field to the Row Area.
System.NullReferenceException was unhandled
_HResult=-2147467261
_message=Object reference not set to an instance of an object.
HResult=-2147467261
IsTransient=false
Message=Object reference not set to an instance of an object.
Source=DevExpress.Xpf.PivotGrid.v15.1
StackTrace:
at DevExpress.Xpf.PivotGrid.Internal.CellsAreaItem.get_IsTotalAppearance()
at DevExpress.Xpf.PivotGrid.Internal.CellsAreaItem.get_ActualMode()
at DevExpress.Xpf.PivotGrid.Internal.CellsAreaItem.GetActualBackgroundBrush()
at DevExpress.Xpf.PivotGrid.Internal.CellsAreaItem.UpdateAppearance()
at DevExpress.Xpf.PivotGrid.Internal.CellsAreaItem…ctor(PivotVisualItems visualItems, Int32 columnIndex, Int32 rowIndex)
at DevExpress.Xpf.PivotGrid.Internal.BestWidthCalculator.BestFitCacheHelper.GetCellSize(FrameworkElement bestFitControl, BestWidthCalculator calculator, IBestFitColumn column, Int32 rowHandle)
at DevExpress.Xpf.PivotGrid.Internal.BestWidthCalculator.RowsBestFitCalculator.CalcRowsBestFit(FrameworkElement bestFitControl, IBestFitColumn column, Double& result)
at DevExpress.Xpf.Core.Native.BestFitCalculatorBase.CalcDataBestFit(IBestFitColumn column, Double& result)
at DevExpress.Xpf.PivotGrid.Internal.BestWidthCalculator.CalcDataBestFitWidthsCore(BestFitResult bestFitResult)
at DevExpress.Xpf.PivotGrid.Internal.BestWidthCalculator.CalcDataBestFitWidths(BestFitResult bestFitResult)
at DevExpress.Xpf.PivotGrid.Internal.BestFitter.CalcDataBestWidths(BestFitResult bestFitResult)
at DevExpress.Xpf.PivotGrid.Internal.BestFitter.SetColumnSizesCore(BestFitLevelFieldValues curColumn, BestFitResult bestFitResult)
at DevExpress.Xpf.PivotGrid.Internal.BestFitter.BestFitColumns(Boolean fitWidth, Boolean fitHeight)
at DevExpress.Xpf.PivotGrid.Internal.BestFitter.BestFit(FieldArea area, Boolean isTreeRowTotalsLocation, Boolean fitWidth, Boolean fitHeight)
at DevExpress.Xpf.PivotGrid.Internal.BestFitter.BestFit(Boolean isTreeRowTotalsLocation, Boolean fitWidth, Boolean fitHeight)
at DevExpress.Xpf.PivotGrid.PivotGridControl.BestFit(Boolean fitWidth, Boolean fitHeight)
at DevExpress.Xpf.PivotGrid.PivotGridControl.BestFit()
at WpfApplication53.MainWindow.pivotGridControl1BestFit() in c:\Work\Projects\WorkExamples\WpfApplication53\WpfApplication53\MainWindow.xaml.cs:line 89
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.DispatcherOperation.InvokeImpl()
at System.Windows.Threading.DispatcherOperation.InvokeInSecurityContext(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at MS.Internal.CulturePreservingExecutionContext.Run(CulturePreservingExecutionContext executionContext, ContextCallback callback, Object state)
at System.Windows.Threading.DispatcherOperation.Invoke()
at System.Windows.Threading.Dispatcher.ProcessQueue()
at System.Windows.Threading.Dispatcher.WndProcHook(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled)
at MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o)
at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
at MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam)
at MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg)
at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
at System.Windows.Application.RunDispatcher(Object ignore)
at System.Windows.Application.RunInternal(Window window)
at System.Windows.Application.Run(Window window)
at System.Windows.Application.Run()
at WpfApplication53.App.Main() in c:\Work\Projects\WorkExamples\WpfApplication53\WpfApplication53\obj\x86\Debug\App.g.cs:line 0
at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
InnerException:
No attached sample ?
Sorry, here is an example.