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

Promt user before creating appointment

4 Answers 83 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Sergey
Top achievements
Rank 1
Sergey asked on 26 Jul 2012, 02:05 PM
I'm using ScheduleView Drag and Drop demo: http://demos.telerik.com/silverlight/#ScheduleView/DragDrop

How can I show message box to prompt the user before committing the drag and drop from the list box operation? This thread recommends to override CanDrop method. I tried the following code:
public override bool CanDrop(DragDropState state)
{
    bool canDrop = false;
     RadWindow.Confirm("Drop the item here?", (window, closedArgs) =>
        {
            if (closedArgs.DialogResult == true)
            {
                canDrop = true;
            }
        });
     return canDrop;
}

but the message box appears as soon as the user hovers mouse cursor over ScheduleView area while dragging, while I need it to appear only on drop.

Overriding Drop method and returning false prevents appointment from being created, but doesn't return it to the ListBox.

 

4 Answers, 1 is accepted

Sort by
0
Bernd
Top achievements
Rank 1
answered on 20 Aug 2012, 01:51 PM
Sergey, did you find a solution to this problem? I am also interested.
0
Sergey
Top achievements
Rank 1
answered on 21 Aug 2012, 12:02 PM
No, Bernd. Still waiting for an answer.
0
Bernd
Top achievements
Rank 1
answered on 22 Aug 2012, 02:29 PM
This link helped me out:
http://www.telerik.com/community/code-library/wpf/scheduleview/how-to-avoid-overlapping-appointments.aspx

In my application the appointments were dragged from one ScheduleView to another one. The following override prevents the source appointment from disappearing in case the drop was canceled (in other case, I have to remove the source appoinment by myself).

public override void DragDropCompleted(DragDropState state)  { }

I think, you should try this with your ListBox.
0
Sergey
Top achievements
Rank 1
answered on 23 Aug 2012, 12:46 PM
Thanks, Bernd! I will try your approach.
Tags
DragAndDrop
Asked by
Sergey
Top achievements
Rank 1
Answers by
Bernd
Top achievements
Rank 1
Sergey
Top achievements
Rank 1
Share this question
or