Exception when using TreeListBox filtering

Grids for WPF Forum

Posted 2 years ago by LONG Philippe
Version: 17.1.0652
Environment: Windows 10 (64-bit)
Avatar

I use a TreeListBox and implement filtering by using a class inherited from StringFilterBase.

When I set the filter value for the first time (and often the second time too), I get an exception.
The following filterings work fine.

Note that some Treenodes can populate their subtree 'on the fly', when they expand or when a filter is set.
I think that filtering is ok when the whole tree is populated.


Here is the stack trace (sorry for the error message which is in french) :

Contextor Studio - Unhandled Dispatcher Error

Impossible d'appeler StartAt quand la génération du contenu est en cours.
____________________________________________________
System.InvalidOperationException

Message:
Impossible d'appeler StartAt quand la génération du contenu est en cours.

Stack Trace:
   à System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(GeneratorPosition position, GeneratorDirection direction, Boolean allowStartAtRealizedItem)
   à System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(GeneratorPosition position, GeneratorDirection direction)
   à System.Windows.Controls.Panel.AddChildren(GeneratorPosition pos, Int32 itemCount)
   à System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
   à System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
   à System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
   à System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   à System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   à System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   à System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   à System.Windows.Controls.ItemCollection.OnViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   à System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   à System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   à MS.Internal.Data.CollectionViewProxy._OnViewChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNodeItemCollection.#hAj(NotifyCollectionChangedEventArgs #yhb)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNodeItemCollection.#FAj(Int32 #ahb, IEnumerable`1 #GAj)
   à ActiproSoftware.Windows.Controls.Grids.TreeListBox.InsertChildTreeNodes(TreeNode treeNode)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#7Aj(Boolean #Ld, TreeListBoxItemAdapter #6Aj, TreeExpansionKind #GAf, Object #BEf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#Axh(TreeExpansionKind #GAf, Object #BEf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#Axh()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#dBj()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#9Aj(IEnumerable #aBj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#njb(IEnumerable #Ld, Boolean #BCf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#rBj(IEnumerable #Ld)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#GM()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#fBj(Boolean #6zj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#0Dj()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.get_IsExpandable()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#bBj()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#9Aj(IEnumerable #aBj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#njb(IEnumerable #Ld, Boolean #BCf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#rBj(IEnumerable #Ld)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#GM()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#fBj(Boolean #6zj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#0Dj()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.get_IsExpandable()
   à ActiproSoftware.Windows.Controls.Grids.TreeListBoxItem.set_TreeNode(TreeNode value)
   à ActiproSoftware.Windows.Controls.Grids.TreeListBox.PrepareContainerForItemOverride(DependencyObject element, Object item)
   à System.Windows.Controls.ItemsControl.MS.Internal.Controls.IGeneratorHost.PrepareItemContainer(DependencyObject container, Object item)
   à System.Windows.Controls.ItemContainerGenerator.System.Windows.Controls.Primitives.IItemContainerGenerator.PrepareItemContainer(DependencyObject container)
   à System.Windows.Controls.Panel.AddChildren(GeneratorPosition pos, Int32 itemCount)
   à System.Windows.Controls.Panel.OnItemsChangedInternal(Object sender, ItemsChangedEventArgs args)
   à System.Windows.Controls.Panel.OnItemsChanged(Object sender, ItemsChangedEventArgs args)
   à System.Windows.Controls.ItemContainerGenerator.OnItemAdded(Object item, Int32 index)
   à System.Windows.Controls.ItemContainerGenerator.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   à System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   à System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   à System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   à System.Windows.Controls.ItemCollection.OnViewCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   à System.Windows.WeakEventManager.ListenerList`1.DeliverEvent(Object sender, EventArgs e, Type managerType)
   à System.Windows.WeakEventManager.DeliverEvent(Object sender, EventArgs args)
   à System.Collections.Specialized.CollectionChangedEventManager.OnCollectionChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Windows.Data.CollectionView.OnCollectionChanged(NotifyCollectionChangedEventArgs args)
   à MS.Internal.Data.CollectionViewProxy._OnViewChanged(Object sender, NotifyCollectionChangedEventArgs args)
   à System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNodeItemCollection.#hAj(NotifyCollectionChangedEventArgs #yhb)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNodeItemCollection.#FAj(Int32 #ahb, IEnumerable`1 #GAj)
   à ActiproSoftware.Windows.Controls.Grids.TreeListBox.InsertChildTreeNodes(TreeNode treeNode)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#7Aj(Boolean #Ld, TreeListBoxItemAdapter #6Aj, TreeExpansionKind #GAf, Object #BEf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#Axh(TreeExpansionKind #GAf, Object #BEf)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#Axh()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#dBj()
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj(#LDj #SDb, Boolean #XDj)
   à ActiproSoftware.Windows.Controls.Grids.Primitives.TreeNode.#WDj()
   à ActiproSoftware.Windows.Controls.Grids.TreeListBox.ApplyFilter()
   à ActiproSoftware.Windows.Controls.Grids.TreeListBox.<>c__DisplayClass183_0.<RequestApplyFilter>b__0()
   à System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   à System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Int32 numArgs, Delegate catchHandler)

TargetSite:
System.IDisposable System.Windows.Controls.Primitives.IItemContainerGenerator.StartAt(System.Windows.Controls.Primitives.GeneratorPosition, System.Windows.Controls.Primitives.GeneratorDirection, Boolean)

Source:
PresentationFramework

HResult:
-2146233079

Comments (1)

Posted 2 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello, can you please email our support address with a simple project that shows this happening so we can debug with that? Please rename the .zip file extension of what you send and don't include the bin/obj folders to prevent spam blocking. If you can do it immediately, we might be able to make any necessary code changes before the new version, which we were hoping to get out today.


Actipro Software Support

The latest build of this product (v2018.1 build 0675) was released 15 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.