- Home
- Forum
- Xamarin.Forms
- How to add multiple images to a date cell in syncfusion sfcalendar in xamarin forms
How to add multiple images to a date cell in syncfusion sfcalendar in xamarin forms
Hey,
Thanks.
Attachment: Customcalendarcell_8db839a2.zip
SIGN IN To post a reply.
3 Replies
SP
Subburaj Pandian Veluchamy
Syncfusion Team
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
Subburaj Pandian V
FL
FEDERICA LAZZERI
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
SP
Subburaj Pandian Veluchamy
Syncfusion Team
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
Subburaj Pandian V
SIGN IN To post a reply.
- 3 Replies
- 3 Participants
-
SG shehan guruge
- Feb 14, 2019 09:16 AM UTC
- Mar 11, 2019 10:45 AM UTC