We bind/rebind a grid to different sources, and every now and then:
> Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.HookInto(Infragistics.Windows.DataPresenter.FieldLayout fieldLayout) + 0x96 bytes Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.GetRecordFilters(Infragistics.Windows.DataPresenter.FieldLayout fieldLayout, bool create) + 0x1c bytes Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.HasActiveFiltersInAnyFieldLayout() + 0x78 bytes Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.ViewableRecordCollection.EnsureFiltersEvaluated() + 0x12b bytes Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.ViewableRecordCollection.Count.get() + 0x10 bytes Infragistics3.Wpf.DataPresenter.v9.1.dll!Infragistics.Windows.DataPresenter.GridViewPanel.MeasureOverride(System.Windows.Size availableSize = {963,742.74}) + 0x491 bytes PresentationFramework.dll!System.Windows.FrameworkElement.MeasureCore(System.Windows.Size availableSize) + 0x387 bytes PresentationCore.dll!System.Windows.UIElement.Measure(System.Windows.Size availableSize = {963,742.74}) + 0x506 bytes PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayout() + 0x481 bytes PresentationCore.dll!System.Windows.ContextLayoutManager.UpdateLayoutCallback(object arg) + 0x27 bytes PresentationCore.dll!System.Windows.Media.MediaContext.FireInvokeOnRenderCallbacks() + 0xd3 bytes PresentationCore.dll!System.Windows.Media.MediaContext.RenderMessageHandlerCore(object resizedCompositionTarget) + 0xcf bytes PresentationCore.dll!System.Windows.Media.MediaContext.AnimatedRenderMessageHandler(object resizedCompositionTarget) + 0x9d bytes WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, bool isSingleParameter) + 0xec bytes WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler = null) + 0x4c bytes WindowsBase.dll!System.Windows.Threading.DispatcherOperation.InvokeImpl() + 0xc0 bytes mscorlib.dll!System.Threading.ExecutionContext.runTryCode(object userData) + 0x178 bytes [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x62 bytes WindowsBase.dll!System.Windows.Threading.DispatcherOperation.Invoke() + 0x6a bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.ProcessQueue() + 0x2b0 bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.WndProcHook(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xb4 bytes WindowsBase.dll!MS.Win32.HwndWrapper.WndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam, ref bool handled) + 0xce bytes WindowsBase.dll!MS.Win32.HwndSubclass.DispatcherCallbackOperation(object o) + 0x96 bytes WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.InternalRealCall(System.Delegate callback, object args, bool isSingleParameter) + 0xec bytes WindowsBase.dll!System.Windows.Threading.ExceptionWrapper.TryCatchWhen(object source = {System.Windows.Threading.Dispatcher}, System.Delegate callback, object args, bool isSingleParameter, System.Delegate catchHandler = null) + 0x4c bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.InvokeImpl(System.Windows.Threading.DispatcherPriority priority, System.TimeSpan timeout, System.Delegate method, object args, bool isSingleParameter) + 0xde bytes WindowsBase.dll!MS.Win32.HwndSubclass.SubclassWndProc(System.IntPtr hwnd, int msg, System.IntPtr wParam, System.IntPtr lParam) + 0x177 bytes [Native to Managed Transition] [Managed to Native Transition] WindowsBase.dll!System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(ref System.Windows.Interop.MSG msg) + 0x46 bytes WindowsBase.dll!System.Windows.Threading.Dispatcher.PushFrameImpl(System.Windows.Threading.DispatcherFrame frame) + 0xf1 bytes PresentationFramework.dll!System.Windows.Application.RunInternal(System.Windows.Window window) + 0xb7 bytes Enerprise.Dashboard.exe!Henwood.Shared.Enerprise.API.Dashboard.App.Main() + 0x70 bytes C# [Native to Managed Transition] [Managed to Native Transition] Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x47 bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x9b bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x4d bytes
AllowFiltering is true, but this occurs even when it is off. There are no active filters. This is with 1006; will try with 2023. Any thoughts?
Hello Sjoerd,
We cannot effectively find the issue just from this stack of code. As you can see, it is being cut out because of its length and does not really give much information on the scenario. It would be better if you attached a file ( and paste this inside it) and gave more information on the problem or contact developer support directly here.
Regards,
Alex.
By the way, I have the source here -- if the stack doesn't give you enough information, I could try to narrow down exactly what's null in the HookInto (I'm betting fieldLayout) and why. Any tips on how to set up a debugging session with the source? Simply attaching does not work.
Was the cause of this issue ever identified? I am also getting null reference exceptions from the same spot.
Normal 0 false false false EN-US X-NONE X-NONE MicrosoftInternetExplorer4
System.NullReferenceException occurred
Message="Object reference not set to an instance of an object."
Source="Infragistics3.Wpf.DataPresenter.v9.1"
StackTrace:
at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.HookInto(FieldLayout fieldLayout)
at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.GetRecordFilters(FieldLayout fieldLayout, Boolean create)
at Infragistics.Windows.DataPresenter.ResolvedRecordFilterCollection.HasActiveFiltersInAnyFieldLayout()
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.EnsureFiltersEvaluated()
at Infragistics.Windows.DataPresenter.ViewableRecordCollection.get_Count()
at Infragistics.Windows.DataPresenter.GridViewPanel.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureCore(Size availableSize)
at System.Windows.UIElement.Measure(Size availableSize)
at System.Windows.ContextLayoutManager.UpdateLayout()
at Infragistics.Windows.DataPresenter.DataPresenterBase.BringRecordIntoView(Record record)
at Infragistics.Windows.DataPresenter.DataPresenterBase.OnActiveRecordChange(Record newActiveRecord, Boolean scrollIntoView)
at Infragistics.Windows.DataPresenter.DataPresenterBase.SetActiveRecord(Record record, Boolean scrollIntoView)
at Infragistics.Windows.DataPresenter.DataPresenterBase.OnCoerceActiveRecord(DependencyObject target, Object value)
at System.Windows.DependencyObject.ProcessCoerceValue(DependencyProperty dp, PropertyMetadata metadata, EntryIndex& entryIndex, Int32& targetIndex, EffectiveValueEntry& newEntry, EffectiveValueEntry& oldEntry, Object& oldValue, Object baseValue, CoerceValueCallback coerceValueCallback, Boolean coerceWithDeferredReference, Boolean skipBaseValueChecks)
at System.Windows.DependencyObject.UpdateEffectiveValue(EntryIndex entryIndex, DependencyProperty dp, PropertyMetadata metadata, EffectiveValueEntry oldEntry, EffectiveValueEntry& newEntry, Boolean coerceWithDeferredReference, OperationType operationType)
at System.Windows.DependencyObject.SetValueCommon(DependencyProperty dp, Object value, PropertyMetadata metadata, Boolean coerceWithDeferredReference, OperationType operationType, Boolean isInternal)
at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Infragistics.Windows.DataPresenter.DataPresenterBase.set_ActiveRecord(Record value)
at CCH.Practice.UI.FAMList.UIClasses.FAMListBase.SetEditableFocus(Int32 rowIndex, String columnName)
Nate
Normal 0 false false false EN-US X-NONE X-NONE
Actually, yes -- it was a race condition. The grid was being initialized twice, at somewhat the same time.
From within our code. We have two treeviews and two dropdowns which influence what is shown in the grid. The initialization of these controls kicked off a reload of the grid, some simultaneously. We fixed it by creating a "don't load yet, we're initializing" state while the periphery is set up, then initiating a single load.
(This state also needed to be invoked when one of the controls influenced another).
First, make sure that your grid is initialized through one and only one function. Then, if you see this happening, set a breakpoint on it. It was quite an eye-opener to see how much different WPF event handling is than anything we were used to.
Hmm... was that from within your code, or from the infragistics library?