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

Issue in Custom Appointment

1 Answer 96 Views
ScheduleView
This is a migrated thread and some comments may be shown as answers.
Ricardo
Top achievements
Rank 1
Ricardo asked on 11 Mar 2014, 05:46 AM
I have a custom template for my Appointments , the main problem is Touch events are not working

I  can click or double click in my custom Appointment but  I can not select  the appointments with touch.

Here is my xaml.


My DataTemplate to fill the  content 
 <DataTemplate x:Key="PatientAppointmentDataTemplate">


        <Grid MinHeight="150">
          
<---> Content

        </Grid>


     </DataTemplate>

My Selector.

<selectors:AppointmentSelector x:Key="DefaultAppointmentStyleSelector">
        <selectors:AppointmentSelector.TodayAppointmentSelector>
            <Style TargetType="telerik:AppointmentItem">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="telerik:AppointmentItem">
                            <ContentControl DataContext="{Binding .}">


                                <i:Interaction.Triggers>

///HACK TO FORCE TO SELECT AN APPOINTMENT

                                    <i:EventTrigger EventName="TouchDown" SourceObject="{Binding RelativeSource={RelativeSource FindAncestor, AncestorType={x:Type telerik:AppointmentItem}}}">
                                        <ei:ChangePropertyAction PropertyName="SelectedAppointment"
                                                                 TargetObject="{Binding RelativeSource={RelativeSource FindAncestor,
                                                                                                                       AncestorType={x:Type telerik:RadScheduleView}}}"
                                                                 Value="{Binding}" />

                                        <i:InvokeCommandAction Command="telerik:RadScheduleViewCommands.EditAppointment" />
                                    </i:EventTrigger>
                                </i:Interaction.Triggers>

                                <Grid x:Name="Root"
                                      Background="Gray"
                                      Focusable="True">
                                    <Grid.InputBindings>
                                        <MouseBinding Command="telerik:RadScheduleViewCommands.EditAppointment" MouseAction="LeftDoubleClick" />
                                    </Grid.InputBindings>

                                    <ContentPresenter ContentTemplate="{StaticResource PatientAppointmentDataTemplate}" />
                                </Grid>
                            </ContentControl>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </selectors:AppointmentSelector.TodayAppointmentSelector>

My Slots have IsReadOnly= False.

I handled  ShowDialog to personalize the edit or delete appointments.

         this.scheduleView.ShowDialog += scheduleView_ShowDialog;


 private async void scheduleView_ShowDialog(object sender, ShowDialogEventArgs e)
        {
            e.Cancel = true;
           /// My code
        }

But this event does not fire too, when I do double touch simulating MouseDoubleClick.


Please help me. Thank you.







1 Answer, 1 is accepted

Sort by
0
Kalin
Telerik team
answered on 13 Mar 2014, 12:35 PM
Hi Ricardo,

Thank you for contacting us.

You won't be able to handle the Touch events as they are handled by our TouchManager in the ScheduleView code. However changing the default template of the Appointments shouldn't cause any issues. We have tested the explained scenario with the default Appointments and were successfully able to select an Appointment by tap and handle the ShowDialog event by double tap. Please try to remove all of the customizations you have made, apply the custom template as simple is possible and let us know if the issue is still present. If so I'll ask you to share some more detailed information about the version of the controls you are using as well as what customizations you have applied.

Hope this will help.

Regards,
Kalin
Telerik
 

DevCraft Q1'14 is here! Watch the online conference to see how this release solves your top-5 .NET challenges. Watch on demand now.

 
Tags
ScheduleView
Asked by
Ricardo
Top achievements
Rank 1
Answers by
Kalin
Telerik team
Share this question
or