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.
SPSubburaj Pandian Veluchamy Syncfusion Team February 15, 2019 05:00 AM
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,
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
FLFEDERICA LAZZERIMarch 8, 2019 10:22 AM
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?
SPSubburaj Pandian Veluchamy Syncfusion Team March 11, 2019 06:45 AM
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.