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

Select Slot on double click

3 Answers 169 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Robertyo Grifalconi
Top achievements
Rank 1
Robertyo Grifalconi asked on 24 Sep 2012, 03:23 PM
Hi,
is there a way to select a slot of ScheduleView on mouse double click instead of mouse right click?

How can i implement it?

Thanks,
Rob

3 Answers, 1 is accepted

Sort by
0
Yana
Telerik team
answered on 27 Sep 2012, 08:36 AM
Hello Rob,

By default on double click over a slot, EditAppointmentDialog is shown.  So in order to change this behavior, you should cancel the dialog. This can be done in ShowDialog event as explained in the following link:
http://www.telerik.com/help/silverlight/radscheduleview-howto-prevent-dialogs-from-opening.html

All the best,
Yana
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

0
Robertyo Grifalconi
Top achievements
Rank 1
answered on 27 Sep 2012, 09:59 AM
Hi Yana,
thanks for your help, but my problem isn't how to modify the behavior about EditAppointmentDialog.

I've already cancel the dialog with:
private void RadScheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
{
    if (e.DialogViewModel is AppointmentDialogViewModel)
	e.Cancel = true;
 
    if (e.DialogViewModel is ConfirmDialogViewModel)     {         e.DefaultDialogResult = true;         e.Cancel = true;     } }


but i've not found the way to know the selected slot at double click.

For example, if i catch the MouseLeftButtonUp event when the user select more than one slot of RadScheduleView i'm able to know which slots are selected like this:

void scheduleView_MouseLeftButtonUp(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
    var radScheduleView = ((RadScheduleView)sender);
    var selectedSlot = radScheduleView.SelectedSlot;

    if (selectedSlot == null)
        return;
    IAppointment app = new Appointment() { Start = selectedSlot.Start, End = selectedSlot.End, Subject = "new appointment" };
    
    //other code here
}

but if i catch the mouseDoubleClick event when the user does a doubleClick over a single slot the radScheduleView.SelectedSlot is always null.

Thanks, Rob
0
Yana
Telerik team
answered on 01 Oct 2012, 08:40 AM
Hi Rob,

I have checked MouseDoubleClick event and was able to get the SelectedSlot in the handler. Could you please confirm that you're using the latest versions of the controls? Can you send us a sample project showing the problem? Thanks in advance.

Regards,
Yana
the Telerik team

Time to cast your vote for Telerik! Tell DevPro Connections and Windows IT Pro why Telerik is your choice. Telerik is nominated in a total of 25 categories.

Tags
ScheduleView
Asked by
Robertyo Grifalconi
Top achievements
Rank 1
Answers by
Yana
Telerik team
Robertyo Grifalconi
Top achievements
Rank 1
Share this question
or