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

How to cancel Double-Click on an appointment (without cancelling the right click context menu)

5 Answers 539 Views
Scheduler and Reminder
This is a migrated thread and some comments may be shown as answers.
Craig
Top achievements
Rank 1
Craig asked on 15 Jun 2016, 01:49 PM

I need the right-click context, so setting the scheduler to readonly isn't an option.

I need to stop the scheduler showing the edit dialog when an appointment is double clicked... Any ideas?

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 15 Jun 2016, 02:09 PM
Hello Craig,

Thank you for writing. 

In order to prevent showing the edit dialog when double clicking an appointment element you can use the following code snippet:
public class CustomScheduler : RadScheduler
{
    public override string ThemeClassName
    {
        get
        {
            return typeof(RadScheduler).FullName;
        }
    }
 
    protected override void OnAppointmentElementDoubleClick(object sender, EventArgs args)
    {
    }
}

I hope this information helps. Should you have further questions I would be glad to help.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Craig
Top achievements
Rank 1
answered on 22 Jun 2016, 11:02 AM

Dess, Thanks for your suggestion.  This was required on an existing code base, so couldn't make use of inheriting from RadScheduler.... Here is how I managed to achieve this without inheriting:

 

private bool _schedulerDoubleClicked;

// Event to catch the double click
private void radScheduler_DoubleClick(object sender, EventArgs e)

{
    _schedulerDoubleClicked = true;
}

// Event to cancel the dialog if the double click was performed
private void radScheduler_AppointmentEditDialogShowing(object sender, AppointmentEditDialogShowingEventArgs e)
{
    if (_schedulerDoubleClicked)
    {
        _schedulerDoubleClicked = false;
        e.Cancel = true;
    }

}

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 23 Jun 2016, 08:06 AM
Hello Craig,

Thank you for writing back. 

I am glad that you have found a suitable solution for your case. However, the suggested approach from my previous post can be applied to any existing application as well. It is just necessary to replace the default RadScheduler instance in the designer file with the custom one. However, your code snippet seems OK. Feel free to use this one which suits your requirement best.

I hope this information helps. If you have any additional questions, please let me know.

Regards,
Dess
Telerik
Check out the Windows Forms project converter, which aids the conversion process from standard Windows Forms applications written in C# or VB to Telerik UI for WinForms.For more information check out this blog post and share your thoughts.
0
Roshdy
Top achievements
Rank 1
answered on 27 Nov 2019, 04:21 PM

Just for Future Reference - the question has been answered perfectly at the time  by Telerik Dev Team it was posted

But to those who might want to disable double click with a single line 

RadScheduler has an event called MouseDoubleClick 

all you need to do is this single line - of course you can encapsulate it according to your requirements

Code in Vb.net

Private Sub RadScheduler1_MouseDoubleClick(sender As Object, e As MouseEventArgs) Handles RadScheduler1.MouseDoubleClick
    RadScheduler1.Behavior.SelectedElement.DoubleClickEnabled = False
End Sub
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 28 Nov 2019, 09:00 AM

Hello, Ahmed,

Thank you for sharing your solution with the community. Indeed, the provided code snippet is an elegant alternative approach for disabling the double click handling for the AppointmentElement

As a reward, I have also updated your Telerik points.

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.
Tags
Scheduler and Reminder
Asked by
Craig
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Craig
Top achievements
Rank 1
Roshdy
Top achievements
Rank 1
Share this question
or