Empty ReadOnly-Slot blocks all DragAndDrop

2 posts, 0 answers
  1. Hendrik
    Hendrik avatar
    3 posts
    Member since:
    May 2014

    Posted 14 Jan 2015 Link to this post

    Hallo Telerik-Team,

    in our application we want to display empty rows in the ScheduleView. These rows are readonly and will have a special look.
    My idea was to create a special kind of Resource (SpacerResource) with a custom style. This works fine and I can add them between the other resources to insert the empty rows. I also generate a readonly SpacerSlot to which I add all the SpacerResources. A custom SpecialSlotStyleSelector is used to display the empty rows the way we want. This also works fine.

    Now for the problem: If no SpacerRow is added to the resources and therefore the SpacerSlot.Resources list is empty, drag&drop of our Appointments does not work anymore. Note that the SpacerSlot is always added to the list of special slots, even when no SpacerResource instances exist. If I add a SpacerResource and "register" it in the SpacerSlot, the drag&drop works again. The ScheduleView is used in TimeLineView only.

    To me this seems to be a bug. Would you please tell me if I do something wrong or if this is indeed an incorrect behavior?

    The special slot is created like this:
    01.public static Slot GenerateSpacerSlot(DateTime viewportStart, DateTime viewportEnd)
    02. {
    03.   return new Slot()
    04.   {
    05.    Start = viewportStart.StartOfDay(),
    06.    End   = viewportEnd.EndOfDay(),
    07.    IsReadOnly = true,
    08.    TimeZone = TimeZoneInfo.Utc,
    09.    RecurrencePattern = new RecurrencePattern(
    10.        null,
    11.        RecurrenceDays.EveryDay,
    12.        RecurrenceFrequency.Weekly,
    13.        1,
    14.        null,
    15.        null)
    16.   };
    17.}

    The parameters define the current viewport displayed. StartOfDay() and EndOfDay() are custom extension methods.


    Regards,

    Hendrik 
  2. Kalin
    Admin
    Kalin avatar
    1209 posts

    Posted 19 Jan 2015 Link to this post

    Hi Hendrik,

    If you have Appointments placed over ReadOnly Slots - you won't be able to drag/drop and modify those Appointments at all (it is demonstrated in this demo). This a behavior intended by design. However I assume your case is different by saying the drag/drop works when the custom Slots have been added. I would like to ask you to share more details - sample code and/or screenshot would be helpful.

    I'm looking forward to hearing from you.

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