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: November 16, 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Add programmatically events to calendar

Thread ID:





117522 Nov 3,2014 01:00 PM UTC Nov 13,2014 08:06 PM UTC WinRT 8
Tags: SfCalendar
Andrea Grillo
Asked On November 3, 2014 01:00 PM UTC

I would ask you how can I add/remove programmatically events to calendar.

In your samples, you add events in the constructor of AppointmentSource class, so I can load events ONLY when I load page.

How can I add/remove dinamically events with custom methods in AppointmentSource class?

Thanks you for the support,

Bharadhi K [Syncfusion]
Replied On November 5, 2014 06:46 AM UTC

Hi Andrea,

Thank you for using Syncfusion Products.

We have prepared a sample in which we have tried to meet your requirements. In sample, we have added a button and in its click event we have added a new appointment for the selected date in the Calendar using “SelectedDate”  Property. Similarly we have added a button for removing the appointment for the Selected Date.

Please find the sample attached.

Bharadhi K

Attachment: SfCalendar_117522_42421573.zip

Andrea Grillo
Replied On November 9, 2014 09:18 PM UTC

thank you for reply.

Now, I can add and remove item, but when I add something, the TransitionContentControl (list) doesn't show me any Appointments (only calendars shows title in the cell template).
I think that DataContext (or something like that) of TransitionContentControl must be refreshed, but I don't know how.

Can you help me, please?

Thank you again,

Bharadhi K [Syncfusion]
Replied On November 10, 2014 12:16 PM UTC

Hi Andrea,

We have modified the sample in which we have tried to meet your requirements. In the sample, we have refreshed the SelectedDate of the Calendar while adding or removing an Appointment.
Please find the attached sample.

Bharadhi K

Attachment: SfCalendar_117522_cb45b877.zip

Andrea Grillo
Replied On November 10, 2014 02:53 PM UTC

thank you for fastly response, but the problem persist.

As you can see in the zip file, when I tap on new user event ("Favorite movie with family" in my screenshots) the list at the bottom of calendar doesn't show it

How can I solve that?


screenshot1: "AppointmentSource" class
screenshot2: appointment loaded in constructor
screenshot3: no detailed information about appointment added in "AddAppointment" method

Attachment: calendar_43cbf8af.zip

Bharadhi K [Syncfusion]
Replied On November 11, 2014 12:53 PM UTC

Hi Andrea,

We are unable to reproduce the issue in the sample which we had updated in the previous update. Could you please check if you have set the SelectedDate of the SfCalendar after you have added the Appointment as we had shown in the provided sample.

Please find the screenshots attached.
Screenshot1 - Appointment loaded in Constructor
ScreenShot2 - Appointment added by clicking the "Add Appointment on Selected Date" button.

Bharadhi K

Attachment: SfCalendar_8180e2f9.zip

Andrea Grillo
Replied On November 11, 2014 10:05 PM UTC

My code seems ok. To be sure, I attached my code files (XAML and code behind).

Sorry for long discussion, I have to thank you!

Attachment: Code_a2bfef79.zip

Bharadhi K [Syncfusion]
Replied On November 13, 2014 09:52 AM UTC

Hi Andrea,

The problem arose because the Resources have been defined for the Page but while refreshing the template, the code is set to get the Resources from App file. To resolve this, please remove the resources defined in MainPage.xaml and add it to the ResourceDictionary of App.xaml (This is done in the sample provided in the previous update).

We have also modified your code. Please find the modified code in the following link.

Bharadhi K

Attachment: Code_b36679d0.zip

Andrea Grillo
Replied On November 13, 2014 08:06 PM UTC

It works fine!

Thank you very much for support me,
bye! :)


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

or the page will be automatically redirected to 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