Hello,
One of the ways we are using the Infragistics drag/drop framework is to re-order items in a list box. This works well except for the one big problem that when dragging we can't scroll the listbox up or down based on mouse position because the drag drop manager is handling all mouse events. This means for the end user that they can only use drag and drop to re-arrange items if the source and target are both initially visible on the screen in the list. I thought about potentially subscribing to the drag over event of the drag sources and add logic there to scroll up or down, however that would be clunky and in fact wouldn't work in our example because not every item in the list box is a valid drop target (and the drag over event only gets fired when over a valid drop target).
Is there any way to achieve the behavior I want using this drag drop component or is it a known limitation?
Thanks,
Chris
Hello Chris,
Would it be possible for you to please provide some more information about how exactly you are hooking up your DragSource and DropTargets in your application with respect to your ListBox in this case?
I ask, as I have created a sample project against the Infragistics for WPF 2016.2, specific version 16.2.20162.2045 in which I hook up the DragSource to the ListBox items by using an ItemTemplate and hooking it to the parent element of that ItemTemplate. Doing this, I am able to drag the items and by dragging them below the normal bounds of that ListBox, it appears that the ListBox is scrolling automatically, which essentially resolves this issue that you are seeing.
I have attached the sample project I have used to test this. If this sample project is not accurate to your scenario, or you are seeing a different behavior with it, please let me know.
Sincerely,AndrewAssociate Developer
Thank you for your response. After further investigation it looks like the difference in behavior is caused by my custom list box releasing mouse capture when a list item is selected. I think for now I can close this thread, I need to investigate further to see if I can get this working now.
-Chris