New to Telerik UI for WPF? Start a free 30-day trial
The ListBoxDragDropBehavior's Drop Event Occurs When CanDrop Returns False
Updated on Sep 15, 2025
Environment
| Product Version | 2023.3.1114 |
| Product | RadListBox for WPF |
Description
The Drop event handler of the RadListBox's default ListBoxDragDropBehavior can occur even if the CanDrop event returns false. This can be present in a scenario when moving fast with the mouse while dragging and dropping an element.
This behavior comes from the WPF framework. When dragging and dropping an element fast, the visual elements that are part of the RadListBoxItem's ControlTemplate invoke the Drop method. It is then bubbled to the RadListBox control.
Solution
Create a new class that derives from the ListBoxDragDropBehavior and override the Drop method. In it, retrieve the return value of the the CanDrop method invocation. If the return value is true, call the base Drop method.
Custom ListBoxDragDropBehavior with overridden Drop method
C#
public class CustomListBoxDragDropBehavior : ListBoxDragDropBehavior
{
public override void Drop(DragDropState state)
{
if (this.CanDrop(state))
{
base.Drop(state);
}
}
}