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

Migrate to new DragDropManager

4 Answers 126 Views
DragAndDrop
This is a migrated thread and some comments may be shown as answers.
Yonggu Kang
Top achievements
Rank 1
Iron
Yonggu Kang asked on 06 Mar 2013, 07:06 AM
Hi telerik,

I've used drag and drop from radwindow to radscheduler without problem utill 2012 Q3,
and now migrate to new drag and drop manager.

I changed DragQuery of RadGridView into new DragInitialize and event fires fine when start drag,
however can't drop in scheduleview nor drag cursor displayed. ScheduleViewDragDropBehavior
of scheduleview is not fired as well regardless of AllowDrop=ture setting in schedulerview.

My code is as follows;
/// GridView xaml for drag
 
                            <telerik:RadGridView.RowStyle>
                                <Style TargetType="telerik:GridViewRow">
                                    <Setter Property="telerik:RadDragAndDropManager.AllowDrag" Value="True" />
                                </Style>
                            </telerik:RadGridView.RowStyle>
 
/// GridView events
 
            DragDropManager.AddDragInitializeHandler(this.prodGridView, OnDragInitialize);
            DragDropManager.AddGiveFeedbackHandler(this.prodGridView, OnGiveFeedback);
 
        private void OnDragInitialize(object sender, DragInitializeEventArgs args)
        {
            args.AllowedEffects = DragDropEffects.All;
            var payload = DragDropPayloadManager.GeneratePayload(null);
            args.Data = ((FrameworkElement)args.OriginalSource).DataContext;
            args.DragVisual = new ContentControl { Content = args.Data, ContentTemplate = this.Resources  ["MachineTemplate"] as DataTemplate };
        }
 
/// schedule view xaml
 
 <telerik:RadScheduleView x:Name="workSkdView" AppointmentsSource="{Binding ProdWorkSkdCollection}"
                                     SpecialSlotStyleSelector="{StaticResource SpecialSlotStyleSelector}"
                                     SpecialSlotsSource="{Binding SpecialSlots}" AllowDrop="True"
                                     CurrentDate="{Binding Path=CurrentDate}">
 
                <telerik:RadScheduleView.ViewDefinitions>
                    <telerik:WeekViewDefinition DayStartTime="08:00:00" DayEndTime="23:59:59" CalendarWeekRule="FirstFourDayWeek"
                                                MajorTickLength="1h" MinorTickLength="30min" StretchGroupHeaders="True" WeekGroupHeaderStringFormat="{}{1:MM}월 {0}주차 " />
                      
                </telerik:RadScheduleView.ViewDefinitions>
 
                <telerik:RadScheduleView.DragDropBehavior>
                    <my:WorkSkdDragDropBehavior />
                </telerik:RadScheduleView.DragDropBehavior>
.
.

Behavior is same with the one you provide in sample.
What am I missing ?  

Thank you in advance.

Kang 


4 Answers, 1 is accepted

Sort by
0
Nick
Telerik team
answered on 07 Mar 2013, 01:42 PM
Hello,

You have to set the DragDropManager.AllowDrag property to true on the elements you want to drag, otherwise, no drag action will be initiated whatsoever.

Hope this makes sense! 

Kind regards,
Nik
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 20 Mar 2013, 04:54 AM
Hi, Nik,

Sorry to come back late.
As I stated on code snippet, I already set AllowDarg as true in GridView whcih is the source of drag & drop.

Kang
0
Yonggu Kang
Top achievements
Rank 1
Iron
answered on 08 Jul 2013, 09:34 AM






0
Nick
Telerik team
answered on 11 Jul 2013, 08:24 AM
Hello,

I honestly cannot say what goes wrong based on the information provided. Perhaps if you share your Drag handlers, or send a sample project we  can find the cause of this behavior. 

Hope this makes sense! 

Regards,
Nik
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
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 >>
Tags
DragAndDrop
Asked by
Yonggu Kang
Top achievements
Rank 1
Iron
Answers by
Nick
Telerik team
Yonggu Kang
Top achievements
Rank 1
Iron
Share this question
or