5 Answers, 1 is accepted
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
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;
}
}
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
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
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