Run time exception when ColorMapping is not set

Hi team,

I've just started exploring the SfSchedule control, and have been able to achieve most of what I want so far.

I am using TimeLineView with ResourceMode="Absolute" to manage resource bookings, but one thing I noticed is that if the ColorMapping property is excluded from ScheduleAppointmentMapping a run time exception occurs:

System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.SfSchedule.UWP.ScheduleAppointmentEngine.UpdateAppointmentColorFromResource(ScheduleAppointment item, Object resourceID)
   at Syncfusion.SfSchedule.UWP.AppointmentEngine.GenerateScheduleAppointments(IEnumerable itemsSource, AppointmentMapping appointmentMapping, DateRange visibleDateRange, String automationId)
   at Syncfusion.SfSchedule.UWP.SfSchedule.GenerateAppointments()
   at Syncfusion.SfSchedule

This can be reproduced using your sample Schedule_MultipleResource and deleting the line ColorMapping="Color" from MainPage.xaml.

The documentation does not indicate that Color is mandatory for the DataSource objects - Creating Custom Appointments

I would prefer to have ColorMapping as optional, perhaps with a DefaultAppointmentColor property on the parent SfSchedule, as currently I must either add Color to my business object class (which I don't want to do as it is shared between projects) or map the business objects into a display class that contains a Color property.  I have implemented the second option, but this causes additional mapping overhead when loading the view, and also for mapping back back any changes made through the SfSchedule.

Please could you advice if I am missing something, or if there is an alternative way of binding objects without a Color property?

Kind regards,
James


3 Replies

MS Muniappan Subramanian Syncfusion Team April 20, 2020 12:14 PM UTC

Hi James, 
 
Thank you for contacting Syncfusion support. 
 
Currently we are analyzing your query “Run time exception when ColorMapping is not set” and we will update you further details on or before April 22, 2020. We appreciate your patience until then. 
 
Regards,   
Muniappan S 



SS SaiGanesh Sakthivel Syncfusion Team April 22, 2020 01:00 PM UTC

Hi James,  
  
Thank you for the patience.  
  
Regarding Color mapping issue while using Resource view  
We will fixed the reported issue in next upcoming weekly Nuget which is rolled on April 28,2020. Until we appreciate your patience. 
  
Regards,  
SaiGanesh Sakthivel


SS SaiGanesh Sakthivel Syncfusion Team April 28, 2020 08:53 AM UTC

Hi James, 
   
We have fixed the reported issue Run time exception when ColorMapping is not set and included the issue fix in our latest Weekly NuGet release update version 18.1.0.46 which is available for download (nuget.org).
  
  
We thank you for your support and appreciate your patience in waiting for this update. Please get in touch with us if you would require any further assistance.   
    
Regards,   
SaiGanesh Sakthivel


Loader.
Up arrow icon