Sort Command?

Shell for WPF Forum

The latest build of this product (v2019.1 build 0685) was released 4 months ago, which was before this thread was created.
Posted 21 days ago by rex hui
Version: 19.1.0685
Avatar

We are implementing a popup menu similar to the Windows Explorer's "Sort by" popup under "View" where the user can choose the items being sorted by "Name", "Date modified", etc and also change the sort direction as well. 

I couldn't figure out how to achieve this. There isn't a Sort Command or a way I can sort the items by a specific column.

Comments (10)

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

Hi Rex,

It looks like we don't yet have a way to externally control sorting.  Internally ShellListView tracks a SortDirection (of type ColumnSortDirection)
and a SortByShellPropertyKey (of type Object).  The latter refers to an IShellProperty.Key value for one of the IShellProperty objects that is a column header.

How would you ideally like to see some of this exposed?  Would you like public SortDirection and SortByShellPropertyKey properties added that you could set?


Actipro Software Support

Posted 20 days ago by rex hui
Avatar

Thank you. I think that will be great!

I assume if I dynamically add/remove a column, I can use the SortByShellPropertyKey property to have the listview updated right?

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

Hi Rex,

We've added this update for the next build:

Added the ShellListView.SortDirection and SortShellPropertyKey properties, which determine how the list is sorted.

If you'd like to test a preview build, please write our support address and reference this thread.


Actipro Software Support

Posted 19 days ago by rex hui
Avatar

Thank you!

Posted 17 days ago by rex hui
Avatar

I have tried the Preview build and everything seems to be working so far. Thank you!

Posted 10 days ago by rex hui
Avatar

On the previous post, I said "I assume if I dynamically add/remove a column, I can use the SortByShellPropertyKey property to have the listview updated right?" That does not seem to be true.

Should you make the "RefreshColumn" of ShellListView public?

I was able to get it work by invoking it through reflection.

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

Hi Rex,

A sort should be occurring immediately when you change the SortShellPropertyKey property.  Can you give us some C# code that we can paste into our ShellListViewIntro QuickStart to see what you are seeing?


Actipro Software Support

Posted 9 days ago by rex hui
Avatar

A sort is being called but the WindowsShellService.CreateProperties is not and where else  can you update the columns other than from WindowsShellService.CreateProperties?

Just realized there is also the "CanColumnsToggleVisibility" inherited from TreeListView but that does not seem to work?

[Modified 9 days ago]

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

Hi Rex,

We are making the ShellListView.UpdateColumns method public in the next maintenance release, and also found the reason the columns weren't showing in the context menu when CanColumnsToggleVisibility was set.  That will be fixed as well.


Actipro Software Support

Posted 5 days ago by rex hui
Avatar

Thank you!

Add Comment

Please log in to a validated account to post comments.