Need a DragDropBehavior solution

4 posts, 0 answers
  1. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 21 Apr 2014 Link to this post

    Hi,

    I created a usercontrol base on a ScheduleView. My user control contain a "OnCanDrop" event and a "SetDataSource" method. When I create my UserControl, I fill the view with ReadOnly slots. The user can use the "SetDataSource" method to fill the view with "Appointments" and "SpecialSlots". Appointments is for appointments and SpecialSlots is for open slots where user can drag apointments into it of where user can create new appointments.

    My objects (appointments and special slots) contain specifics members for logical purpose.

    What I'm trying to do in my a drag and drop behavior, it's to raise my event with the source appointment the user is dragging and the specialslot where the user is trying to drop or drag over so the user can decide if the appointment is trying to drag can be drop or not on the specialslot I raised through my event base on a logic he decided.

    If I have an appointment from 8h00 to 8h15 and I want to drag it in the special slot 8h15 to 8h30. I want to raise my event only when I'm over the special slot not after each mouse move of my appointment.

    Thank's
    Alain
  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 22 Apr 2014 Link to this post

    Hello Alain,

    I have already answered you almost the same question in the following forum thread:
    http://www.telerik.com/forums/detexting-if-i-am-on-the-same-slot

    You didn't answered anything there, did you give it a try and if so why it didn't work for you? I'm afraid this would be only solution for the desired scenario we can suggest with the current implementation of the ScheduleView.

    Hope this helps.

    Regards,
    Kalin
    Telerik
     

    Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

     
  3. UI for WPF is Visual Studio 2017 Ready
  4. Christie Admin
    Christie Admin avatar
    239 posts
    Member since:
    Aug 2013

    Posted 22 Apr 2014 in reply to Kalin Link to this post

    Hi Kalin,

    I'm sorry I didn't get the reply :(

    I cannot use SnapAppointments in my approach because I need to let the user drag an appointment to a minute close to his current start time.

    Regarding the other issue, with the destinationslots, I need to cast it in my own object to access a specific member when raizing my vent?!?

    Thank's
    Alain
  5. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 23 Apr 2014 Link to this post

    Hi Alain,

    As Yana has already explained in the other this forum thread the only solution for the DestinationSlots question would be to manually check whether the SpecialSlots collection contains a Slot that overlaps with the destination one using the IntersectsWith extension method. Check the attached sample project which demonstrates the exact approach.

    Hope this will work for you.

    Regards,
    Kalin
    Telerik
     
    Check out Telerik Analytics, the service which allows developers to discover app usage patterns, analyze user data, log exceptions, solve problems and profile application performance at run time. Watch the videos and start improving your app based on facts, not hunches.
     
Back to Top