Migrate to new DragDropManager

5 posts, 0 answers
  1. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 06 Mar 2013 Link to this post

    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 


  2. Nick
    Admin
    Nick avatar
    593 posts

    Posted 07 Mar 2013 Link to this post

    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.

  3. DevCraft banner
  4. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 19 Mar 2013 Link to this post

    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
  5. YongKoo Kang
    YongKoo Kang avatar
    101 posts
    Member since:
    Jan 2010

    Posted 08 Jul 2013 Link to this post







  6. Nick
    Admin
    Nick avatar
    593 posts

    Posted 11 Jul 2013 Link to this post

    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 >>
Back to Top
DevCraft banner