Drop event not fired
Environment
Product Version | 2019.2.618 |
Product | RadListBox for WPF |
Description
How to get the RadListBoxItem element under the mouse when DragDropManager.DragOver or DragDropManager.Drop is fired for RadListBox.
Solution
In the DragOver or Drop event handler, get the OriginalSource of the event arguments. This is the element under the mouse. From it, you can use the ParentOfType
private void OnRadListBoxDragOver(object sender, Telerik.Windows.DragDrop.DragEventArgs e)
{
var elementUnderMouse = (FrameworkElement)e.OriginalSource;
var item = elementUnderMouse.ParentOfType<RadListBoxItem>();
}