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

DragDrop inside RadWindow in Q2 2011 SP1

1 Answer 27 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Kotte
Top achievements
Rank 1
Kotte asked on 27 Sep 2011, 08:48 PM

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.

1 Answer, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 28 Sep 2011, 08:17 AM
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 >>

Tags
ScheduleView
Asked by
Kotte
Top achievements
Rank 1
Answers by
Yana
Telerik team
Share this question
or