TreeListBox - Resetting filter changes selected item

Grids for WPF Forum

The latest build of this product (v2020.1.1) was released 2 months ago, which was before this thread was created.
Posted 18 days ago by Dirk Zellerfeld
Version: 20.1.1
Platform: .NET 5.0
Environment: Windows 10 (64-bit)

I have a treelistbox and a search textbox. The treelistbox has a simple string filter based on StringFilterBase which is bound to the textbox's text. The treelistbox AutoExpandItemsOnFilter is set to TRUE.

At start when all items are not expanded and I search for something, I select a sub item and then clear the search text which sets the IsFilterActive property to false.

For some reason the selected item is not what I selected. Instead it bubbles its way up to the first non expanded item.

You can actually reproduce this on the demo application. Go to Grids -> TreelistBox Quickstarts -> Filtering. Enable AutoExpandItemsOnFilter, enable IsFilterActive and search for "Alberta". Its a sub item of "Canada". Select it. Now uncheck "IsFilterActive". The selection goes back to "Canada" although Alberta is still visible and expected to still be selected.

This is quite annoying imagine we have a large item collection and on disabling the filter it jumps to the top while the user has selected an item at the bottom of the list.

I think this behavior was changed in one of the last updates (not the latest). I feel like this was not the case in an earlier version.

[Modified 18 days ago]

Comments (2)

Answer - Posted 18 days ago by Actipro Software Support - Cleveland, OH, USA

Hi Dirk,

I went back to v2017.1 (first Grids release) and it was happening back then as well with the steps you gave.

We were able to update the code to ensure that when disabling filtering, any ancestor nodes of currently-selected nodes will remain expanded.  This update will be in the next maintenance release.

Actipro Software Support

Posted 17 days ago by Dirk Zellerfeld

Well, my mind is aging as well, lol. This would be amazing if its getting fixed. I just need to get our business administrator to upgrade to the latest major release, so we will be able to get this fixed version.

Add Comment

Please log in to a validated account to post comments.