Completed
Last Updated: 06 Dec 2019 14:27 by ADMIN
Release R1 2020 (LIB 2019.3.1209)
Bert
Created on: 29 Nov 2019 07:27
Category: Scheduler/Reminder
Type: Bug Report
0
RadScheduler: Incorrect appointment is drag-dropped

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);

5 comments
ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 05 Dec 2019 13:56

Hello, Bert, 

The provided workaround seems to work on my end in a Visual Studio project. I have attached my sample project for your reference where the provided gif file illustrates the improved behavior.

I have contacted the OpenEdge support engineers for further assistance on this case and why the workaround throws a System.Reflection.AmbiguousMatchException. It seems that you already have an OpenEdge support case on this topic. Feel free to continue the communication regarding the exception there.

As to the fix, we will do our best to introduce a fix as soon as possible and include it in one of the upcoming LIBs. Please make sure that follow this item. Thus, you will get notified once the status has been changed.

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Bert
Posted on: 03 Dec 2019 12:21
it doesn't seem to be possible to get the workaround working, we would like to know if you have an idea when this issue will be resolved in the control itself as this is a major issue for our customers.  
Bert
Posted on: 02 Dec 2019 16:19

So a workaround for a workaround...

What would be the input parameters for the GetElementAtPoint? I've tried:

this.Scheduler.ElementTree.Control, this.Scheduler.ElementTree.RootElement, args.Location, ? 

This gives no errors, but doesn't allow me to drag an appointment. The GetElementAtPoint never returns an element.

I started at Progress supportlink, but when I wanted to create a case for the use of a Telerik control I got redirected here.

 

ADMIN
Dess | Tech Support Engineer, Sr.
Posted on: 02 Dec 2019 14:28
Hello, Bert, 

Using the ElementTree.GetElementAtPointmethod is a standard approach for extracting the element that is located under the mouse in a normal .NET application. However, after some research, it seems to have some problems using it in an OpenEdge environment: https://knowledgebase.progress.com/articles/Article/Reflection-error-calling-Telerik-GetElementAtPoint-method 

I understand that you are using OpenEdge and Developer Studio, please note that for OpenEdge related topics the preferred places to submit a technical question are Salesforce and the Progress Community. You can log in to these websites straight from your Progress account: https://progresslink.progress.com/supportlink   

I hope this information helps.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Bert
Posted on: 02 Dec 2019 10:47

This workaround doens't work for us. We are getting following exception:

System.Reflection.AmbiguousMatchException: Ambiguous match found.

on following statement:

SchedulerCellElement cell = this.Scheduler.ElementTree.GetElementAtPoint(args.Location) as SchedulerCellElement;