Cancelled Drop On RadScheduleView Still Removes Item From ListBox

6 posts, 0 answers
  1. Anthony
    Anthony avatar
    63 posts
    Member since:
    Aug 2011

    Posted 31 Oct 2013 Link to this post

    Hi,

    I am dragging items between a ListBox and a RadScheduleView.

    On a successful drag and drop the item is removed from the ListBox and added to the RadScheduleView.

    If I decide to cancel the Drop in my custom ScheduleViewDragDropBehavior overidden Drop method  the RadScheduleView behaves correctly and does not add the item. However the ListBox still removes the item.

    How can I stop the ListBox from removing the item when the Drop is cancelled by the RadScheduleView?

    Thanks
    Anthony

  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 05 Nov 2013 Link to this post

    Hello Anthony,

    The information you provided is not enough for a general solution, however I can suggest that the poroblem is that you are removing the item from the listbox, without checking the DragEffects first, you can try to modify your logic to check if the effects are equal to something that requires the item to be deleted and remove the item only then.

    Hope this helps! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  3. Anthony
    Anthony avatar
    63 posts
    Member since:
    Aug 2011

    Posted 05 Nov 2013 Link to this post

    Hi,

    To clarify, my code is never removing the item from the ListBox, the Telerik drag and drop infrastructure is doing the removal automatically.

    It should not remove the item from the ListBox if the drop is cancelled on the RadScheduleView.

    Thanks
    Anthony
  4. Nick
    Admin
    Nick avatar
    593 posts

    Posted 06 Nov 2013 Link to this post

    Hello Anthony,

    In that case, you can inherit from the default behaviors and override the actions on Drop, DragDropCompleted etc. 

    Hope this helps! 


    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
  5. Anthony
    Anthony avatar
    63 posts
    Member since:
    Aug 2011

    Posted 06 Nov 2013 Link to this post

    Hi,

    I can override DragDropCompleted in the ListBoxDragDropBehavior for the source control but there is nothing in the DragDropState that indicates that the drop was cancelled by the destination control.

    I would need to keep track of this manually which is a bit ugly.

    It seems that the DragDropState should pass additional information so a user can correctly determine state.

    Thanks
    Anthony
  6. Nick
    Admin
    Nick avatar
    593 posts

    Posted 08 Nov 2013 Link to this post

    Hello Anthony,

    You are absolutely right. We will try to include this in one of our next releases, in the mean time you will have to handle this manually. 

    We are sorry for any inconvenience caused! 

    Regards,
    Nik
    Telerik
    TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top