Upgrade Scheduler from 18.1.0.52 to 18.2.0.44

We have an existing scheduler control with a custom event template and a complex AppointmentData model.

In the control version 18.1.0.52 the scheduler renders and works fine and without problems.
If we upgrade now to 18.2.0.44 and adjust also the css and js paths to 

<link rel='nofollow' href="https://cdn.syncfusion.com/blazor/18.2.44/styles/bootstrap4.css" rel="stylesheet" />
<script src="https://cdn.syncfusion.com/blazor/18.2.44/syncfusion-blazor.min.js"></script>

the scheduler throws following error "Invalid cast from 'System.DateTime' to 'System.DateTimeOffset'".

If we disable the custom template for the events, the scheduler works fine. If we include our template and use our data model the controls throws the named error.
Also if  we only do the following in the template:

...
<ScheduleViews>
  <ScheduleView Option="View.TimelineDay">
    <EventTemplate>
    @{
        var appointmentData = (context as EmployeeAppointment);
        <span>@(appointmentData.Name)</span>
     }
   </EventTemplate>
  </ScheduleViews
</ScheduleViews>
...

and not request the child properties or any DateTime property, the scheduler throws this error. What are the differences in this 2 versions?

Is it possible that it is the internal logic of the scheduler which request more than we want out of the data appointment or is it a scheduler problem?
We are sorry, we can't show you the whole code because of NDAs with our clients. But if you need more information let us know.

Thanks

11 Replies

AK Alagumeena Kalaiselvan Syncfusion Team July 14, 2020 03:28 PM UTC

Dear Customer, 

We have checked your reported error with Scheduler which have EventTemplate and package version as 18.2.0.44 but unfortunately we could not replicate the reported issue at our end. Also, we have prepared a sample based on your provided details as like package version, script and style references which can be download from the below link. 

Kindly share the below details which may helpful to procced further 
  • Did you get the error by any Scheduler interactions or at initial load alone?
  • Share issue reproducing scenario
  • Replicate your issue with shared sample

Regards 
Alagumeena.K 



ZD ZMI Dev July 17, 2020 06:28 AM UTC

Thanks for you answer. I have further information for this problem:

  • The error occurs, when I initial load the scheduler and when the custom data model (in my case "EmployeeAppointment") was accessed the first time.
  • It is not necessary how much appointments there are. It appears at only oine
  • I don't need to draw the data, it instantly happens by only casting the model in the template. It's enough to only do "var appointmentData = (context as EmployeeAppointment);" in the EventTemplate, nothing else.
  • And I get a second error if I "outcomment" all possible models with a DateTime or DateTimeOffset in it by writing a [JsonIgnore] over it:

  • It seems, that since the new upgrade the Scheduler accesses the data differently and crashes at "DateTime/Offset" properties and also on "Color" properties. FYI: I removed the Color property and instead I used the string option. Thats ok for me, but it's curious that this is the second property which doesn't work anymore.
  • When I write the color property at the first position in the event data model, than I get this error at first.
  • When I outcomment all Color and DateTime/Offset properties the scheduler renders without my needed infos/colors and so on.
Why is it working in the version before? I don't changed something and only upgraded the syncfusion library.
Why is the Serialization is not working anymore?
Did I miss something at the upgrade?



AK Alagumeena Kalaiselvan Syncfusion Team July 20, 2020 12:20 PM UTC

Dear Customer, 

Thanks for sharing details with us. 

Query #1: Issue occur when the custom data model accessed  

We have re-evaluated the above query and we request to share the custom data model for Scheduler to replicate and check the serialization issue at our end. 

Query #2: Getting error while defining Color property 

We have checked your reported issue and we suggest you to define the Color property as string instead of using System.Drawing namespace. 

Kindly share the details for Q1 to check this issue and provide the solution without any delay. 

Regards 
Alagumeena.K 



ZD ZMI Dev July 21, 2020 06:21 AM UTC

This is my Appointment Model:

        public bool IsPlaceHolder { get; set; } = false;
 
        public bool IsDragAndDropped { get; set; } = false;
 
        public string Name { get; set; }
 
        public string AvailableChronoTime { get; set; }
 
        public string CssStyleString
        {
            get
            {
                if (IsPlaceHolder)
                {
                    return "background-color: #1f1f1f4d; cursor: no-drop";
                }
                return BackgroundColorString != string.Empty ? "background-color: " + BackgroundColorString : string.Empty;
            }
        }
 
        public double ChronoScore { get; set; }
 
        public DateTime StartTime { get; set; }
 
        public DateTime EndTime { get; set; }
 
        public TimeSpan Duration
        {
            get
            {
                return EndTime.Subtract(StartTime);
            }
        }
 
        public string BackgroundColorString { get; set; }
 
        public Guid Id { get; set; }
 
        public Guid EmployeeId { get; set; }
 
        public Employee Employee { get; set; }
 
        public Guid RecommendedWorkShiftId { get; set; }
 
        public WorkShift RecommendedWorkShift { get; set; }
 
        public EmployeeChronoTypificationAppointment()
        {
            Id = Guid.NewGuid();
        }

But this maybe not help, because the "Employee" and the "WorkShift" are classes from the database structure with a deep hierarchy and many DateTimeOffsets in it. Like I said before, if I comment them out, it works, but with missing informations for my view because of the missing models. If it's important: These properties are lazy loaded initially on site load and are then set for the data source. But this makes no problems before the upgrade.

I don't know if it is helpful, but while playing around with the code because of this problem I got the same error like the guys here:
https://www.syncfusion.com/feedback/16086/showcolumnchooser-cannot-read-property-blazor-instance-of-null
I commented there also. For me it seems that the internal serialization or the data handling changed after the upgrade. But thats only my poit of view with the informations which I could found.


AK Alagumeena Kalaiselvan Syncfusion Team July 22, 2020 02:53 PM UTC

Dear Customer, 

Thanks for your update. 
We have investigated the reported error “blazor _instance of null” in the shared feedback and we suspect that the issue might be the presence of other components in your application/page. So, kindly share the following details to validate it further at our end. 
  • whether you have used any other Syncfusion components other than Scheduler.
  • call stack of your issue.
  • when the issue throws whether on page navigation or any other specific action.

Regards 
Alagumeena.K  



TK Timo Keller July 24, 2020 05:25 AM UTC

I can confirm the above case. I have created a new Blazor Server App, then just created the Scheduler Control and it works until 18.1.0.59, after updating to 18.2.X it does not work anymore.

I have tried it on both Mac and Windows with the same result.


AK Alagumeena Kalaiselvan Syncfusion Team July 27, 2020 12:31 PM UTC

Hi Timo, 

Could you please confirm whether you have faced “blazor _instance of null” issue with Scheduler component. If so, kindly share the requested details in our previous update to validate the issue at our end. 

Regards 
Alagumeena.K 



ZD ZMI Dev replied to Alagumeena Kalaiselvan July 28, 2020 06:18 AM UTC

Dear Customer, 

Thanks for your update. 
We have investigated the reported error “blazor _instance of null” in the shared feedback and we suspect that the issue might be the presence of other components in your application/page. So, kindly share the following details to validate it further at our end. 
  • whether you have used any other Syncfusion components other than Scheduler.
  • call stack of your issue.
  • when the issue throws whether on page navigation or any other specific action.

Regards 
Alagumeena.K  


I checked this again. I have some new information for you:
  • whether you have used any other Syncfusion components other than Scheduler.
Yes, I used a SfToolTip inside an event in the scheduler to show some information if the space is to small.
  • call stack of your issue.
The error which I get is:
and the template for this tooltip looks like the following:

There is no complex data or something else. But if I remove this SfTooltip it works fine in 18.2.0.46.
  • when the issue throws whether on page navigation or any other specific action.
The issue is thrown when I adjust the scheduler by clicking on a button which sorts/manipulates the appointments by code and in the .razor the appointmentData should be accessed. The error happens not on initial load.


AK Alagumeena Kalaiselvan Syncfusion Team July 29, 2020 01:31 PM UTC

Dear Customer, 

Thanks for sharing required details with us. 

As per the shared details, we have checked the reported case in scheduler with Tooltip component and we could replicate this issue at our end. We have already considered this issue “blazor _instance of null” with Tooltip component and you can track this issue status using the following link. 

This fix for this issue will be included in our patch release which is Scheduled at the end of August, 2020.  

Regards 
Alagumeena.K 



ZD ZMI Dev July 29, 2020 01:41 PM UTC

I can't watch the link, I get the an "Access Denied" error.


VM Vengatesh Maniraj Syncfusion Team July 30, 2020 06:01 AM UTC

Hi Denny, 

Sorry for the inconvenience. 

We have updated the feedback link and you can access it now. 


Regards, 
Vengatesh  


Loader.
Up arrow icon