We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

What de best method to select line when SfScheduler is set Day View property

Hi,
I have one SFScheduler that is demonstrated in MonthView. When I clink in one day, I call OnMonthInlineAppointmentLoadedEvent method and change de view to DayView.
So, when I click um one appointment again, I not know the event method I need associate in SfSchduler component to execute other actions in my app.
I need you help, please.

5 Replies

KA Karthikraja Arumugam Syncfusion Team January 10, 2020 10:25 AM UTC

Hi Henrique, 
 
Thank you for contacting Syncfusion support. 
 
We have checked your requirement of “Triggering event while appointment is tapped in DayView”. Schedule CellTapped event will trigger on appointment tapped in DayView, in CellTapped event handler you can get appointment details from e.Appointment property.  
 
In MonthView, if your requirement is only switching to DayView on MonthInlineAppointmentLoadedEvent you can simply use CellTapped event, in which e.Appointments property will hold appointments of the clicked month cell. 
 
Please refer the following code example for the same, 
 
[C#] 
schedule.CellTapped += Schedule_CellTapped; 
 
private async void Schedule_CellTapped(object sender, CellTappedEventArgs e) 
{ 
            if (e.Appointment != null && schedule.ScheduleView == ScheduleView.DayView) 
            { 
                    await App.Current.MainPage.DisplayAlert("", "Day view appointment tapped", "Okay"); 
            } 
            else if (e.Appointments != null && schedule.ScheduleView == ScheduleView.MonthView) 
            { 
                      schedule.ScheduleView = ScheduleView.DayView; 
            } 
  } 
 
We have prepared a sample based on your requirement, 
 
You can also refer our UG documentation to know more about events in Schedule, 
 
We hope this helps. Please let us know if you would require any further assistance. 
 
Regards, 
Karthik Raja A 



HE Henrique January 13, 2020 07:11 PM UTC

So, the method that sended to me is ok. But now, I need get properties from CellTappedEventArgs. I'm using 

var _apontamento = e.Appointment;

But, when I need get one properties, exemple ContactId, I can see this property in the watch panel but, when put the e.Appointment.ContactID I can see only .ToString() method and none properties.

You can send me the best practice to get properties in CellTappedEventArgs please?

Tks a lot.


KA Karthikraja Arumugam Syncfusion Team January 14, 2020 12:29 PM UTC

Hi Henrique, 
 
Thank you for the update. 
 
The properties of the appointment can get by casting the Appointment with appointment class, if it is Schedule appointment use ScheduleAppointment class or if it is custom appointment use that custom appointment class. 
 
Please refer the following code example for the same, 
 
[C#] 
private void Schedule_CellTapped(object sender, CellTappedEventArgs e) 
{ 
            if (e.Appointment != null && schedule.ScheduleView == ScheduleView.DayView) 
            { 
                   //  Here, appointment class is Meeting. 
                   var ID = (e.Appointment as Meeting).ContactID; 
            } 
} 
 
We have prepared a sample based on your requirements, 
 
We hope this helps. Please let us know if you would require any further assistance. 
 
Regards, 
Karthik Raja A 



HE Henrique January 14, 2020 12:56 PM UTC

Tks a lot. Its all ok now.


KA Karthikraja Arumugam Syncfusion Team January 15, 2020 07:24 AM UTC

Hi Henrique, 
 
Thank you for the update. 
 
Please get in touch with us if you would require further assistance. We are always happy to assist you. 
 
Regards, 
Karthik Raja A 


Loader.
Live Chat Icon For mobile
Up arrow icon