Flattened TreeListView Column Sorting

Posted 21 days ago by Avatar Darcy Davidson


I am trying to implement column sorting on a flattened tree list view.  I have captured the column clicks, set the column's sort direction (which as far as I can tell is just GUI manipulation), and implemented a custom IComparer on my underlying observable collection's default ICollectionView, and called it's refresh method (and confirmed that the sorting is working as desired by inspecting the ICollectionView's internal list).  I can't determine why my view doesn't follow suit.



[Modified 20 days ago]

Comments (4)

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

Hi D'Arcy,

Yes the column.SortDirection just is pure GUI and shows the column header glyph.  If the UI isn't updating, perhaps the control isn't getting a notification that the collection changed.  Are you positive that whatever collection/view you are using for the children is implementing INotifyCollectionChanged and raising its events properly?  If not, then our control UI won't update on changes.  I'd first verify that.

Actipro Software Support
Posted 18 days ago by Darcy Davidson


Sent sample app to support address.



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


Thanks for the sample.  The error was that in you adapter.GetChildren method, you were returning "lvr.Children" instead of "_collectionView".  If you change that, it works fine since _collectionView is what you are sorting and properly notifies of changes..

Actipro Software Support
Posted 18 days ago by Darcy Davidson

Thanks!  Admittedly i am a little confused, as my understanding is that bindings to observable collections are essentially binding to the underlying default CollectionView, so it seems wierd that I have to expicitly return the CollectionView as opposed to the ObservableCollection. (With other controls I have never had to do this).

Anyways, moving on, and not losing any sleep.

Thanks again.

[Modified 18 days ago]

Information The latest build of this product (2018.1 build 0673) was released 7 days ago, which was after the last post in this thread.

Add a Comment

Please log in to a validated account to post comments.