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

Drag and drop multiple appointments

3 Answers 117 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
BALOGOUN
Top achievements
Rank 1
BALOGOUN asked on 17 Dec 2012, 11:49 AM
Hello,

I would like to drag and drop multiple appointment located in several different resources. The default behavior of scheduleView is that all appointments are dropped into the pointed resource row on mouse release. What I want is a slide up or down of each item selected, keeping them at the same distance from each other's at the mouse release. You will see what I really want on attached pictures.

AB.

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 19 Dec 2012, 05:56 PM
Hello,

What you need can be achieved with a custom DragDrop behavior for the ScheudleView control. The attached sample project demonstrates how a behavior similar to what you need can be achieved. Please notice that this approach have some limitations and works completely only in TimelineView and only with single resource per appointment.

Hope this helps.

Regards,
Miroslav Nedyalkov
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
BALOGOUN
Top achievements
Rank 1
answered on 27 Dec 2012, 02:17 PM
Hello,

Thank you for your quick response and it responds perfectly to my problematic. I would also like to ask you how I can implement a custom visual cue drag when a set of appointment is dragged.

Regards,
AB.
0
Yana
Telerik team
answered on 02 Jan 2013, 01:09 PM
Hello,

You should customize the DragVisualTemplate property of the ScheduleView. 

DragVisualTemplate property is of type DataTemplate and is used to define the content of the DragVisual.  It receives as DataContext a list of the dragged appointments (or occurrences in case of recurrent appointments).

Here is the default DragVisualTemplate:

<telerik:DraggedAppointmentsToLocalizedStringConverter x:Key="DraggedAppointmentsToLocalizedStringConverter" />
<DataTemplate x:Key="DragVisualContentTemplate">
<TextBlock Text="{Binding Converter={StaticResource DraggedAppointmentsToLocalizedStringConverter}}" TextWrapping="Wrap" MaxWidth="200"
            MaxHeight="66" TextTrimming="WordEllipsis" />
</DataTemplate>

Note the use of DraggedAppointmentsToLocalizedStringConverter – it is needed to cover  the cases when multiple appointments are dragged. You could change the template and the converter according to your needs. Then just set the newly created template to the DragVisualTemplate property of the ScheduleView:

<telerik:RadScheduleView AppointmentsSource="{Binding Appointments}"
            DragVisualTemplate="{StaticResource DragVisualContentTemplate}">
    ...
</telerik:RadScheduleView>

Hope this helps. Regards,
Yana
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
ScheduleView
Asked by
BALOGOUN
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
BALOGOUN
Top achievements
Rank 1
Yana
Telerik team
Share this question
or