Please run the attached sample project and follow the steps illustrated in the gif file. Not always the selected appointment is dragged.
Workaround:
public class CustomSchedulerInputBheavior : SchedulerInputBehavior
{
public CustomSchedulerInputBheavior(RadScheduler scheduler) : base(scheduler)
{
}
Point mouseDownPosition = Point.Empty;
public override bool HandleMouseDown(MouseEventArgs args)
{
mouseDownPosition = args.Location;
return base.HandleMouseDown(args);
}
public override bool HandleMouseMove(MouseEventArgs args)
{
SchedulerCellElement cell = this.Scheduler.ElementTree.GetElementAtPoint(args.Location) as SchedulerCellElement;
AppointmentElement appointment = this.Scheduler.ElementTree.GetElementAtPoint(args.Location) as AppointmentElement;
if (appointment == null)
{
appointment = this.Scheduler.ElementTree.GetElementAtPoint(this.mouseDownPosition) as AppointmentElement;
}
if (this.Scheduler.Behavior.ItemCapture != null && (this.Scheduler.Behavior.ItemCapture.Parent is RadScrollBarElement ||
this.Scheduler.Behavior.ItemCapture is RadScrollBarElement))
{
return false;
}
if (this.Scheduler.Capture && args.Button == MouseButtons.Left)
{
appointment = this.Scheduler.ElementTree.GetElementAtPoint(this.mouseDownPosition) as AppointmentElement;
FieldInfo fi = typeof(SchedulerInputBehavior).GetField("selecting", BindingFlags.Instance| BindingFlags.NonPublic);
bool selecting = (bool)fi.GetValue(this);
if (selecting)
{
if (cell != null && cell.AllowSelection && args.Button == MouseButtons.Left)
{
this.SelectCell(cell, true);
}
}
else if (this.Scheduler.SchedulerElement.ResizeBehavior.IsResizing)
{
this.Scheduler.SchedulerElement.ResizeBehavior.Resize(args.Location);
}
else if (appointment != null && IsRealDrag(args.Location))
{
this.Scheduler.Capture = false;
this.Scheduler.DragDropBehavior.BeginDrag((SchedulerVisualElement)appointment.Parent, appointment);
return true;
}
}
else
{
if (appointment != null)
{
this.Scheduler.SchedulerElement.ResizeBehavior.RequestResize(appointment, (SchedulerVisualElement)appointment.Parent, false);
}
else
{
this.Scheduler.Cursor = Cursors.Default;
}
}
return false;
}
private void SelectCell(SchedulerCellElement cell, bool extend)
{
this.Scheduler.SelectionBehavior.SelectCell(cell, extend);
}
}
this.radScheduler1.SchedulerInputBehavior = new CustomSchedulerInputBheavior(this.radScheduler1);