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

Draging a Appointment in Month View changes the Times to 00:00

3 Answers 47 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Denis Cilliers
Top achievements
Rank 1
Denis Cilliers asked on 04 Jan 2013, 10:48 AM
Why would dragging an appointment in Month-View reset the times for the Appointment

While dragging the appointment in the Week-view or the Day-view does not change the times 

How would I resolve this?

3 Answers, 1 is accepted

Sort by
0
Ivan Todorov
Telerik team
answered on 09 Jan 2013, 08:54 AM
Hello Denis,

Thank you for contacting us.

It appears that this is an issue in the dragging behavior of RadScheduler. The issue has been logged and we will address it in a next release. Here you can track the PITS item: http://www.telerik.com/support/pits.aspx#/public/winforms/13950. For the time being, you can modify this behavior by creating a custom AppointmentDraggingBehavior. Here is how this can be achieved:
public partial class Form1 : Form
{
    public Form1()
    {
        InitializeComponent();
        this.radScheduler1.SchedulerElement.DragDropBehavior = new MyDraggingBehavior(this.radScheduler1.SchedulerElement);
    }
}
 
class MyDraggingBehavior : AppointmentDraggingBehavior
{
    public MyDraggingBehavior(RadSchedulerElement element)
        : base(element) { }
 
    public override bool Move(DateTime newDate)
    {
        if (this.Scheduler.ActiveViewType == SchedulerViewType.Month)
        {
            newDate = newDate.Add(this.ActiveFeedback.AssociatedAppointment.Start.TimeOfDay);
        }
        return base.Move(newDate);
    }
}

Your Telerik points have been updated. Feel free to ask if you have any further questions.

All the best,
Ivan Todorov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
0
Denis Cilliers
Top achievements
Rank 1
answered on 09 Jan 2013, 09:45 AM
Hi Ivan 

Thanks for the workaround, I will give it a bash in VB.net 

:)
0
Accepted
Ivan Todorov
Telerik team
answered on 11 Jan 2013, 02:49 PM
Hello Denis,

Here is the same code in VB:
Public Partial Class Form1
    Inherits Form
    Public Sub New()
        InitializeComponent()
        Me.radScheduler1.SchedulerElement.DragDropBehavior = New MyDraggingBehavior(Me.radScheduler1.SchedulerElement)
    End Sub
End Class
 
Class MyDraggingBehavior
    Inherits AppointmentDraggingBehavior
    Public Sub New(element As RadSchedulerElement)
        MyBase.New(element)
    End Sub
 
    Public Overrides Function Move(newDate As DateTime) As Boolean
        If Me.Scheduler.ActiveViewType = SchedulerViewType.Month Then
            newDate = newDate.Add(Me.ActiveFeedback.AssociatedAppointment.Start.TimeOfDay)
        End If
        Return MyBase.Move(newDate)
    End Function
End Class

In such cases you can use our online C#-to-VB converter located at http://converter.telerik.com/.

If you have any future questions, do not hesitate to ask.

Regards,
Ivan Todorov
the Telerik team
Q3'12 SP1 of RadControls for WinForms is out now. See what's new.
Tags
Scheduler and Reminder
Asked by
Denis Cilliers
Top achievements
Rank 1
Answers by
Ivan Todorov
Telerik team
Denis Cilliers
Top achievements
Rank 1
Share this question
or