This is a migrated thread and some comments may be shown as answers.

RadListBox does not invoke DragDropCompleted Handler

3 Answers 138 Views
ListBox
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 25 Mar 2015, 05:35 AM
I'm guessing this is yet another bug in the RadListBox event handeling:

Create a RadListBox and set it up for Drag and Drop, and then attach handlers for DragInitialized and DragDropCompleted.

Drag and Drop Items and observe:

1. Dragging item from one list box to another does both DragInitialized and DragDropCompleted (correct)
2. Dragging an item to an invalid target and dropping does both DragInitialized and DragDropCompleted (correct)
3. Dragging and item and pressing ESC to cancel also does both DragInitialized and DragDropCompleted (correct)

However...

4. Dragging and item to another position in the same listbox to rearrange only calls DragInitialized handler.  The DragDropCompelted handler is never called. (BUG!)

This screen cast demonstrates: http://screencast.com/t/mx9yQx0EdtZx

David

3 Answers, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 25 Mar 2015, 09:19 AM
Hi David,

Can you please share some more details on how exactly you have implemented the drag drop functionality? From the provided video looks like that you are using ListBoxDragDropBehavior as well as the DragDropManager. Mixing both of the approaches can cause such an issue as the ListBoxDragDropBehavior uses internally the DragDropManager and handles some of events inside. What I can suggest you would to simply use a custom ListBoxDragDropBehavior and override the needed methods - this way everything should work as expected:

public class CustomListBoxDragDropBehavior : ListBoxDragDropBehavior
{
    public override bool CanStartDrag(DragDropState state)
    {
        return base.CanStartDrag(state);
    }
 
    public override void DragDropCompleted(DragDropState state)
    {           
        base.DragDropCompleted(state);
    }
}

Hope this helps.

Regards,
Kalin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
0
David
Top achievements
Rank 1
answered on 25 Mar 2015, 02:04 PM
Okay, what you suggest will work I guess, but still seems wrong.

Firstly, the DragDropManager methods for adding a handler have a third paramater that claim to bubble the event to your handeler even if already marked as handled (if you pass true).  For example:

DragDropManager.AddDragDropCompletedHandler(RightListBox, OnDragComplete, true);

And curiously, it works... for every situation except rearranging items in a list.  So that is perplexing.



0
Kalin
Telerik team
answered on 27 Mar 2015, 11:55 AM
Hi David,

Thanks for your feedback. I reproduced the explained behavior, however will need some more time in order to further investigate whether this is an issue or expected behavior. Meanwhile you can simply use a custom ListBoxDragDropBehavior in order get notified once those events occur.

Thanks for understanding.

Regards,
Kalin
Telerik
 

See What's Next in App Development. Register for TelerikNEXT.

 
Tags
ListBox
Asked by
David
Top achievements
Rank 1
Answers by
Kalin
Telerik team
David
Top achievements
Rank 1
Share this question
or