TreeListBox Extended SelectionMode and Drag Drop that adds functionality when holding Ctrl key

Grids for WPF Forum

Posted 9 months ago by Dan Hutt
Version: 19.1.0686
Avatar

Hi all!

I've been wondering if some functionality I'm trying to add is possible. Currently, we have a tree that has the Selection Mode set to Extended so our users can select disparate nodes with Ctrl and Shift. However, we have an additional requirement to provide functionality (copy) when the selected items are dropped while holding the Ctrl key. However, I'm running into an issue where the Selection side of things is being processed and preventing the Drag&Drop from initiating, so holding Ctrl and Left mouse and initiaiting drag on a selected item just changes the selection state of that item.

Is there some work around for this? Single selection mode doesn't have this issue obviously, but we have a hard requirement of extended selection mode.

Thanks!

[Modified 9 months ago]

Comments (6)

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

Hi Dan,

To restate the issue, you have a TreeListBox with MultiDragKind property set to something other than None, and you have multiple selected items.  Then you hold Ctrl and try and press the mouse button down on an already-selected item to drag all the selected items, but instead of being able to start moving to drag, it is deselecting the item.  Is that the problem behavior you are describing?

It seems like the native WPF ListView control always deselects a selected item when Ctrl is held while pressing the mouse button over the item (same as what TreeListBox currently does), while Windows Explorer's lists will only deselect a selected item when Ctrl is held when releasing the mouse button over an item.  They probably do this for the reason you state.  Is that the behavior change you'd like to see implemented?


Actipro Software Support

Posted 9 months ago by Dan Hutt
Avatar

I believe your restatement of my issue is correct.

The behavior you describe would be great - it looks like selection is being handled on MouseDown and if it were on MouseUp I think we would be golden, since drag would be handled as part of MouseDown and PointerMoved. Also, if there is a solution I would love to hear if it would be possible without upgrading Actipro for the time being as we're currently blocked due to some implicated UI changes that aren't approved by the company (yet). I appreciate your time!

[Modified 9 months ago]

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

Hi Dan,

To clarify, any change in behavior would only be made when there multi-select is enabled and you click on an already-selected item.  In that case only, selection changes would be made on mouse up, assuming no drag occurred.  In all other cases, it would still act as it does now with mouse down changing selection.  I think that keeps things consistent with how the Windows Explorer list works.

This would be an internal code change so there's not a way to get it to work in the current version.  End users would need to release the Ctrl key before starting a drag in the current version.


Actipro Software Support

Posted 9 months ago by Dan Hutt
Avatar

No worries, I may be able to expedite an upgrade and this only helps my case. Your clarification is exactly what we're hoping for. I can communicate this to our design team and hopefully put a pin in the feature since it is minor.

Thank you for your help!

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

Hi Dan,

We've completed the updates for this.  They will roll into the first v24.1 release.


Actipro Software Support

Posted 9 months ago by Dan Hutt
Avatar

Thank you so much! I really appreciate your prompt responses!

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

Add Comment

Please log in to a validated account to post comments.