Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
515
Disable control (ctrl) key behaviour in XamScheduleView
posted

Hello,

I have a question regarding the control (ctrl) key and the XamScheduleView.  When I hold the control button down and drag a schedule I'm getting some strange behaviour. 

Above I have a schedule in my XamScheduleView.  Now if I hold the control button and drag the schedule 1 hour to the right it automatically duplicates the schedule and then drags the new copy of the schedule to the right, as below:

 

I have 2 questions in regard to this behaviour:

1) Why is the control key causing a new copy of the schedule to be created when it is dragged?

2) How can I stop it from doing this?

In my application it is not allowed for there to be overlapping schedules.  I am checking for overlapping schedules whenever new schedules are made/existing schedules are changed and have those parts working properly, but this duplication behaviour is causing me some problems, and since this behaviour is not needed for my application I'd like to disable it.

Thank you!

 

Parents
No Data
Reply
  • 54937
    Offline posted

    JPUser said:

    1) Why is the control key causing a new copy of the schedule to be created when it is dragged?

    Because that is the standard behavior for the control key. The same behavior is exhibited in Outlook - a copy of the activity is displayed during the drag when the Control key is pressed (whether the key is pressed before the drag starts or during the drag). If the Control key is down when the drag is completed (i.e. when the mouse is released) then a copy is made.

    JPUser said:

    2) How can I stop it from doing this?

    Copying is supported as long as adding is supported since copying is just a matter of making a new activity with the same property values and adding it to the control. So you could disable adding (e.g. set ScheduleSettings->AllowAdd to false). However, if you are allowing dragging across calendars then that would mean that dragging between calendars is not supported since part of the verification for dragging between calendars is to check if the source calendar supports removal and the target calendar supports addition since logically that is what is happening when an activity is moved between calendars.

    JPUser said:

    In my application it is not allowed for there to be overlapping schedules.  I am checking for overlapping schedules whenever new schedules are made/existing schedules are changed and have those parts working properly, but this duplication behaviour is causing me some problems, and since this behaviour is not needed for my application I'd like to disable it.

    Currently there is no event raised during a drag operation for each move so I'm not sure why copy is any different for you then dragging an existing activity with regards to overlapping activities. At the end of the drag operation either the original activity is edited (in which case you can compare the information of the old and new activity - e.g. in the ActivityChanging event) or a new activity is added (i.e. ActivityAdding is raised).

    If you need any additional functionality you can submit a feature request here.

Children