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

single click to edit appointment

5 Answers 19 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Kenneth
Top achievements
Rank 2
Kenneth asked on 20 Mar 2015, 03:27 PM
Is there a way to detect a click (mouseleftbuttonup) on an appointment rather than the doubleclick?

AppointmentSelectionChanged is close but can be fired in situations other than a click.

I don't use the edit dialog but I want to show appointment details on single click.  Currently I am trapping the ShowDialog event which is fired on the double-click of an appointment but I would rather do it on a single click.

5 Answers, 1 is accepted

Sort by
0
Kenneth
Top achievements
Rank 2
answered on 23 Mar 2015, 12:44 PM
I should also say this is in month-view.
0
Rosi
Telerik team
answered on 24 Mar 2015, 11:25 AM
Hi,


To complete the described task I would suggest you to use the SelectedAppointment property, bind to it and display its details. However I can see that you already explored this option.

Another option is to edit the AppointmentTemplate and find the code below:

<telerik:CommandManager.InputBindings>
                        <telerik:InputBindingCollection>
                            <telerik:MouseBinding Gesture="LeftDoubleClick" Command="{StaticResource EditAppointment}" />
                        </telerik:InputBindingCollection>
                    </telerik:CommandManager.InputBindings>


where you can easily change the Gesture and Command properties.

For more details how to change the Appointment's template you can read here and here.
0
Trajce
Top achievements
Rank 1
answered on 04 Apr 2017, 06:25 AM

Hi, I have the same problem. I've made CustomAppointmentStyleSelector with OverrideDefaultAppointment template. I've done this inside:

<Grid.InputBindings>
<MouseBinding MouseAction="RightClick" Command="{x:Staticm scheduleView:RadScheduleViewCommands.EditAppointment}"/>  </Grid.InputBindings>

I also made scheduleView_ShowDialog method, where i cancel opening default appointment editing window and open custom one. Everything worked fine, until I've used MouseAction="LeftDoubleClick" (this opened my view and worked fine). When i changed mouse action to RightClick, first click on the appointment doesn't do anything and every second click works.

Do you maybe know what am I doing wrong?

 

I wanted to attach video, but i get an error: (allowed: .jpg, .jpeg, .gif, .png). So here is link to my dropbox: https://www.dropbox.com/s/4yfsxkrxydnsh3s/SchedulerTelerik.swf?dl=0

 

Regards, 

Hipokrat

 

 

0
Trajce
Top achievements
Rank 1
answered on 04 Apr 2017, 07:01 AM
I just realized that I did not post this in right section, i use telerik for WPF...
0
Stefan Nenchev
Telerik team
answered on 06 Apr 2017, 03:24 PM
Hello,

We cannot be sure what is happening in your exact scenario based on only the video provided. An alternative approach that you can try is the following logic in the PreviewMouseLeftButtonDown event of the RadScheduleView control:

private void RadScheduleView_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
       {
           if ((e.OriginalSource as UIElement).ParentOfType<AppointmentItem>() != null)
           {
               Dispatcher.BeginInvoke(System.Windows.Threading.DispatcherPriority.Render, (Action)(() =>
               {
                   RadScheduleViewCommands.EditAppointment.Execute(scheduleView.SelectedAppointment, scheduleView);
               }));
           }
       }


Regards,
Stefan Nenchev
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
ScheduleView
Asked by
Kenneth
Top achievements
Rank 2
Answers by
Kenneth
Top achievements
Rank 2
Rosi
Telerik team
Trajce
Top achievements
Rank 1
Stefan Nenchev
Telerik team
Share this question
or