Promt user before creating appointment

5 posts, 0 answers
  1. Sergey
    Sergey avatar
    26 posts
    Member since:
    Jun 2012

    Posted 26 Jul 2012 Link to this post

    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.

     
  2. Bernd
    Bernd avatar
    3 posts
    Member since:
    May 2012

    Posted 20 Aug 2012 Link to this post

    Sergey, did you find a solution to this problem? I am also interested.
  3. DevCraft banner
  4. Sergey
    Sergey avatar
    26 posts
    Member since:
    Jun 2012

    Posted 21 Aug 2012 Link to this post

    No, Bernd. Still waiting for an answer.
  5. Bernd
    Bernd avatar
    3 posts
    Member since:
    May 2012

    Posted 22 Aug 2012 Link to this post

    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.
  6. Sergey
    Sergey avatar
    26 posts
    Member since:
    Jun 2012

    Posted 23 Aug 2012 Link to this post

    Thanks, Bernd! I will try your approach.
Back to Top
DevCraft banner