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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

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

Thread ID:

Created:

Updated:

Platform:

Replies:

150519 Jan 9,2020 02:31 PM UTC Jan 15,2020 07:24 AM UTC Xamarin.Forms 5
loading
Tags: SfSchedule
Henrique
Asked On January 9, 2020 02:31 PM UTC

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.

Karthikraja Arumugam [Syncfusion]
Replied On 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 


Henrique
Replied On 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.

Karthikraja Arumugam [Syncfusion]
Replied On 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 


Henrique
Replied On January 14, 2020 12:56 PM UTC

Tks a lot. Its all ok now.

Karthikraja Arumugam [Syncfusion]
Replied On 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 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

Live Chat Icon For mobile
Live Chat Icon