TreeListBox - Resetting filter changes selected item

Grids for WPF Forum

Posted 3 years ago by Dirk Zellerfeld
Version: 20.1.1
Platform: .NET 5.0
Environment: Windows 10 (64-bit)
Avatar

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 3 years ago]

Comments (2)

Answer - Posted 3 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

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 3 years ago by Dirk Zellerfeld
Avatar

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.

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

Add Comment

Please log in to a validated account to post comments.