Shell tree doesn't automagically scorll selected item into place when used in popupbutton

Shell for WPF Forum

Posted 5 years ago by Douglas Gerard - Jackalope Technologies, inc.
Version: 19.1.0682
Platform: .NET 4.8
Environment: Windows 10 (64-bit)

I have a simple project that uses a popup button to select a folder.

When opened via the pop up the control displays, but doesn't scroll to the selected item.

Any help making this happen would be appreciated.

See project here.


[Modified 5 years ago]

Comments (1)

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

Thanks for the sample.  I believe the problem is that you might be setting SelectedDirectory too early, before shell data has loaded.  Then it fails to find anything and the control ends up selecting the first item as it loads, which replaces your SelectedDirectory value.  

If you remove all the popup event handlers and do this instead, it seems to work:

this.Dispatcher.BeginInvoke(DispatcherPriority.Loaded, (Action)(() => {
	SelectedDirectory = @"C:\Games";

Actipro Software Support

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

Add Comment

Please log in to a validated account to post comments.