Urgent - SfGrid and SfPivotView causing fatal exceptions when the collection provided to their DataSource is empty.

Updated to 19.2.0.46 from 19.1.0.59 and SfPivotView and SfGrid are now causing issues. It is unusable as is without additional checks for the collection being empty. Sample attached to reproduce the exceptions.


SfPivotView produces the following exception:

System.NullReferenceException: Object reference not set to an instance of an object.

        at Syncfusion.Blazor.PivotView.Internal.GridColumnHeader`1.c__DisplayClass10_0.BuildRenderTree

            b__3(RenderTreeBuilder __builder3)

            at Microsoft.AspNetCore.Components.Rendering.RenderTreeBuilder.AddContent(Int32 sequence, RenderFragment fragment)

            at Syncfusion.Blazor.Grids.Internal.GridHeader`1.BuildRenderTree(RenderTreeBuilder __builder)

            at Microsoft.AspNetCore.Components.ComponentBase..ctor

                b__6_0(RenderTreeBuilder builder)

                at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment)

                at Microsoft.AspNetCore.Components.RenderTree.Renderer.RenderInExistingBatch(RenderQueueEntry renderQueueEntry)

                at Microsoft.AspNetCore.Components.RenderTree.Renderer.ProcessRenderQueue()


SfGrid only throws the exception if the datasource is an ObservableCollection<T>, the exception is slightly different but I have bundled them together into one issue due to the similarities in the cause:

System.InvalidOperationException: This operation is only valid on generic types.

        at System.RuntimeType.GetGenericTypeDefinition()

        at Syncfusion.Blazor.Grids.SfGrid`1.IsObservableCollection(Object data)

        at Syncfusion.Blazor.Grids.SfGrid`1.DataProcess(ActionArgs action, ActionEventArgs`1 actionArgs)

        at Syncfusion.Blazor.Grids.SfGrid`1.DataProcess(ActionArgs action, ActionEventArgs`1 actionArgs)

        at Syncfusion.Blazor.Grids.SfGrid`1.ModelChanged(ActionEventArgs`1 args, Object additionalArgs)

        at Syncfusion.Blazor.Grids.SfGrid`1.OnParametersSetAsync()

        at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)

        at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)


Attachment: Grid_and_PivotView__Null_reference_bug_b4829678.zip

5 Replies

RN Rahul Narayanasamy Syncfusion Team July 13, 2021 11:52 AM UTC

Hi Lee Stevens,  

Greetings from Syncfusion. 

Query:  Updated to 19.2.0.46 from 19.1.0.59 - SfGrid only throws the exception if the datasource is an ObservableCollection<T>, the exception is slightly different but I have bundled them together into one issue due to the similarities in the cause: 

We have checked your query and we have confirmed it as a bug and logged the defect report “Exception throws while changing Grid datasource(which is an observable collection) to empty” for the same. Thank you for taking the time to report this issue and helping us improve our product. At Syncfusion, we are committed to fixing all validated defects (subject to technological feasibility and Product Development Life Cycle ) and including the defect fix in our upcoming bi-weekly release which is expected to be rolled on July 21, 2021.   
      
You can now track the current status of your request, review the proposed resolution timeline, and contact us for any further inquiries through this link.   
     

Until then we appreciate your patience.  
 
Query: Pivot View issue 
 
We are able to reproduce the problem and we are analyzing the problem at our end. We will update further details within two business days (July 15, 2021). 

Regards,  
Rahul  
 



RN Rahul Narayanasamy Syncfusion Team July 15, 2021 06:18 AM UTC

Hi Lee, 
 
Thanks for your patience. 
 
For PivotView issue: 

We have considered the reported issue as a bug and logged the defect report “Exception throws while updating pivot table with empty datasource” for the same. We will include the fix in our upcoming weekly patch release which is estimated to be rolled out on 21st July 2021. You can keep track the issue in the feedback link below. We appreciate your patience until then.  

  
Note: You must login to view the above feedback link since it is private.  
  
Regards, 
Rahul 




LS Lee Stevens July 15, 2021 10:31 AM UTC

Thanks Rahul, we will check the release on the 21st July to see if it fixes the issues.

Unfortunately, we won't be able to use that version if the bug reported with the SfSchedule control is not fixed.



JP Jeevakanth Palaniappan Syncfusion Team July 16, 2021 05:23 AM UTC

Hi Lee, 

We will let you know once the issue is fixed in the promised release. Until then we appreciate your patience. 
For schedule query you can follow up in the below forum. 

Regards, 
Jeevakanth SP. 



RN Rahul Narayanasamy Syncfusion Team July 23, 2021 03:50 AM UTC

Hi Lee 

We are glad to announce that our weekly patch release (v19.2.0.48) has been rolled out successfully and in this release, we have included the fix for issues Exception throws while changing Grid datasource(which is an observable collection) to empty” and “Exception throws while updating pivot table with empty datasource”. So kindly update your NuGet (Syncfusion.Blazor) to our latest version to resolve the reported issue 

Please find the Nuget package and release notes from below 


Release Note:  

We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance.  

Regards, 
Rahul 

 


Loader.
Up arrow icon