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

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

6 Answers 145 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
sebastien
Top achievements
Rank 1
sebastien asked on 16 Oct 2015, 10:38 AM

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

 

6 Answers, 1 is accepted

Sort by
0
sebastien
Top achievements
Rank 1
answered on 16 Oct 2015, 11:14 AM

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"/>​

0
Nasko
Telerik team
answered on 20 Oct 2015, 02:27 PM
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
0
sebastien
Top achievements
Rank 1
answered on 19 Jan 2017, 04:22 PM

We've left this issue unsolved for a long time.  There was probably a misunderstanding at the very beginning: the "Resource GroupHeader" we want as drop target is the GroupHeader Label Text box itself like the grey "Room 1" in the mentioned example. (see attached picture).  It is not the range of time slot below Room1.

We've tried to use the custom DragDropBehavior for this case without success.  The CanDrop method never fires when you move over the wanted target "Room <X>" like if the group header label was not controlled by the scheduleView drag drop behavior.

Are we dealing with a limitation of the DragDropBehavior?

/Sébastien

 

 

 

0
Nasko
Telerik team
answered on 23 Jan 2017, 09:44 AM
Hi Sebastien,

We have created a sample project that demonstrates the described in my initial response approach.

Basically, inside the GroupHeader using GroupHeaderContentTemplateSelector we created a Template that contains TextBlock with AllowDrop property set to True. After that using the DragDropManager we implemented a DragDrop functionality for that TextBlock to allow dropping appointments on it.

Please, check the example - when you drop an item from the DataGrid placed on the left side of RadScheduleView into the GroupHeader the AppointmentsDialog gets visualized and an appointment could be created.

We hope this will help you.

Regards,
Nasko
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
0
sebastien
Top achievements
Rank 1
answered on 23 Jan 2017, 02:44 PM

Hello Nasko, thank you very much for your sample.  We are currently implementing it in our app and this looks very promising.

Best regards

/S

0
Nasko
Telerik team
answered on 24 Jan 2017, 07:05 AM
Hi Sabastien,

I am glad to here the provided sample was helpful for you. Please, take as much as time as you need to implement the proposed solution in you application. Meanwhile, if you have any additional questions or concerns regarding the proposed approach or for some of our other controls, please do not hesitate to contact us.

Regards,
Nasko
Telerik by Progress
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which allow you to write beautiful native mobile apps using a single shared C# codebase.
Tags
ScheduleView
Asked by
sebastien
Top achievements
Rank 1
Answers by
sebastien
Top achievements
Rank 1
Nasko
Telerik team
Share this question
or