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

How to add multiple images to a date cell in syncfusion sfcalendar in xamarin forms

Thread ID:

Created:

Updated:

Platform:

Replies:

142666 Feb 14,2019 09:16 AM UTC Mar 11,2019 10:45 AM UTC Xamarin.Forms 3
loading
Tags: SfCalendar
shehan guruge
Asked On February 14, 2019 09:16 AM UTC

Hey,

I want to have a customized date cell in which it's capable of holding multiple images(Like the image which I have attached herewith). I want to know whether if I am capable enough to customize the cell according to my requirements, and if it is how am I able to implement it using xamarin forms.

Thanks.

Attachment: Customcalendarcell_8db839a2.zip

Subburaj Pandian Veluchamy [Syncfusion]
Replied On February 15, 2019 10:00 AM UTC

Hi Shehan, 
 
Thank you for contacting Syncfusion support. 
 
Based on the provided information, your requirement of “Customizing the Calendar month cell with the images” in Xamarin.Forms can be achieved using CellTemplate property of MonthViewSettings and OnMonthCellLoaded event of Calendar. Using this event, you can get the Date and appointment details of the particular cell and you can set your desired customized view in the View property in MonthCellLoadedEventArgs argument. 
 
We have prepared sample based on your requirement, 
 
Sample link: CalendarCellTemplate 
 
In the sample, we have set customized view using CellTemplate and get the values from OnMonthCellLoaded event. We have loaded date, icon to indicate appointment availability and appointments count in the particular date. 
 
You can use either CellTemplate property of MonthViewSettings or View property of MonthCellLoadedEventArgs in OnMonthCellLoaded event of Calendar to set the customized view instead of date in month cell. 
 
We hope this helps. 
 
Regards,
Subburaj Pandian V  


FEDERICA LAZZERI
Replied On March 8, 2019 03:22 PM UTC

Hi, having a similar target i need to apply your suggested solution but I have a further difficulty:
The data i need to use to populate the cell template are coming from a "web service" (called asynchronous) so when the OnMonthCellLoaded fires the server has not yet sent the data back to me, so i can't put in the template the right values.

I could i solve this?
Is there a way to modify the calendar's cells AFTER they have been loaded in the event you are referring?

thanks

Subburaj Pandian Veluchamy [Syncfusion]
Replied On March 11, 2019 10:45 AM UTC

Hi Federica, 
 
We have checked your query “Is there a way to modify the calendar's cells AFTER they have been loaded in the event you are referring”. Since OnMonthCellLoaded event is synchronous process, using this in asynchronous way is not recommended one. So, we suggest you to populate the async data from the server, once got the required data populate the template to OnMonthCellLoaded approach. 
  
Though, you can achieve your requirement by calling Refresh method in calendar to update the template for month view once the view rendered but we suspect it may cause performance delay since we are rendering UI twice based on data source.  
 
Kindly refer the below code example for the same, 
  
[C#] 
Calendar.Refresh(); 
  
Please let us know, if this help full. 
 
Regards,
Subburaj Pandian V 


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

;