DragDrop inside RadWindow in Q2 2011 SP1

2 posts, 0 answers
  1. Kotte
    Kotte avatar
    48 posts
    Member since:
    Feb 2011

    Posted 27 Sep 2011 Link to this post


    Hi Telerik,

    we are creating a RadWindow using below code and we got a RadSchedulerView inside the usercontrol which is the content of the RadWindow and This is common method in our application.


    var radWindow = new RadWindow
                                        {
                                            VerticalContentAlignment = VerticalAlignment.Stretch,
                                            HorizontalContentAlignment = HorizontalAlignment.Center,
                                            Header = menuCaption,
                                            Tag = windowId,
                                            Content = content,
                                            Width = width,
                                            Height = height,
                                            IsRestricted = true,
                                            WindowStartupLocation =
                                            Telerik.Windows.Controls.WindowStartupLocation.CenterScreen,
                                            RestrictedAreaMargin =
                                            new Thickness(RestrictedAreaLeft, RestrictedAreaTop,
                                                              RestrictedAreaRight, RestrictedAreaBottom)
                                        };


    Adding the DragDrop behavior to the control.

                    RadDragAndDropManager.SetAllowDrag((UserControl)content, true);
                    RadDragAndDropManager.AddDragQueryHandler((UserControl)content, OnDragQuery);
                    RadDragAndDropManager.AddDragInfoHandler((UserControl)content, OnDragInfo);

    On the RadSchesuler when I start drag,CanStartDrag event fires and CanDrop event never fires.
    I think one of the above methods are overriding the CanDrop method on CustomDragDropBehavior class.


    Any suggestions to make DragDrop work for RadSchedulerView inside RadWindow.

    public class CustomDragDropBehavior : Telerik.Windows.Controls.ScheduleViewDragDropBehavior 
        {
            public override bool CanDrop(DragDropState state)
            {
                return true;
            }


            public override bool CanStartDrag(DragDropState state)
            {          


                return true;
            }


            public override void Drop(DragDropState state)
            {
                base.Drop(state);
            }
           
    }


    Thanks,
    Kotte.
  2. Yana
    Admin
    Yana avatar
    4712 posts

    Posted 28 Sep 2011 Link to this post

    Hi Kotte,

    Actually this is expected - there are some changes in the DragDropBehavior of the ScheduleView in the latest version, that's why you cannot use it together with the RadDragAndDropManager.

    Please send us more information about your exact scenario and we'll try to find a suitable solution. Thanks

    Greetings,
    Yana
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top