RadScheduleView allow a drop event on given resource on the group header left side (not in a time slot)

3 posts, 0 answers
  1. sebastien
    sebastien avatar
    6 posts
    Member since:
    May 2015

    Posted 16 Oct 2015 Link to this post

    Hello there,

    We already manage drag and drop operations fine ​to a RadScheduleView target in an empty slot or on an existing Appointment.  However we ​need to manage a drop event on a given resource on the left-hand side of the Schedule-View (resources displayed vertically here).  I mean in this case, we do not drop on a time slot, but on a resource header.

    Just to make it clear : if a drop occurs on a given slot, we can already create an appointment for that slot.  ​Now we would like to provide an action "Create Appointment for that resource and find our the time slot automatically based on some business logic".  You see?

    So far, it seems the DragDropBehavior.CanDrop() method is not involved when we drag over the resource header on the left side of the ScheduleView.

    Thanks

    /Sébastien Lacroix

     
  2. sebastien
    sebastien avatar
    6 posts
    Member since:
    May 2015

    Posted 16 Oct 2015 Link to this post

    hmmm, after sending, I realize I should probably define some dragDrop behavoResource Header I am talking about, in the VerticalResourceTemplate.  For now we handle it with a simple TextBlock.  I just tried to set the AllowDrop attribute without success.  Any suggestion would be greatly appreciated.

    <selectors:OrientedGroupHeaderContentTemplateSelector.VerticalResourceTemplate>

                    <DataTemplate>
                        <Border Height="{Binding DataContext.Preferences.HorizontalBarresHeight, RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type local:PlanningView}}}"
                                Width="150">
                            <StackPanel Margin="1">
                                <TextBlock FontSize="12"
                                           AllowDrop="true" 
                                           Foreground="Black"
                                           Margin="0"
                                           Text="{Binding Name.DisplayName}"
                                           TextWrapping="Wrap"
                                           VerticalAlignment="Center"/>​

  3. UI for WPF is Visual Studio 2017 Ready
  4. Nasko
    Admin
    Nasko avatar
    586 posts

    Posted 20 Oct 2015 Link to this post

    Hello Sebastien,

    In order to achieve the desired you need to modify the default DragDrop behavior of RadScheduleView and have a UI element inside the GroupHeader inside which you will drop the appointment.

    We suggest you to check the following sample project from our SDK Repository that demonstrates how to implement such custom behavior:
    https://github.com/telerik/xaml-sdk/tree/master/ScheduleView/CustomDragDropBehavior

    You could use it as a start point for your scenario. Basically, the approach is the same however, instead of dropping inside ListBox you need to implement your logic for dropping inside the GroupHeader.

    Hope this helps.

    Regards,
    Nasko
    Telerik
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Back to Top