Error when collapsing DetailTemplate when DataGrid only has 1 entry (v. 18.2.46)

To replicate: 

1. Copy the sample code from https://blazor.syncfusion.com/documentation/datagrid/row/#detail-template

2. Modify Enumerable.Range(1, 9) to Enumerable.Range(1, 1) so that there's only 1 row / entry

3. Expand the DetailTemplate. Expansion succeeds.

4. Collapse the DetailTemplate. Collapse fails and the following message is printed out on the logs:

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Nullable object must have a value.
System.InvalidOperationException: Nullable object must have a value.
   at System.Nullable`1[[System.Int32, System.Private.CoreLib, Version=5.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e]].get_Value()
   at Syncfusion.Blazor.Grids.Internal.Selection`1.<ClearRowSelection>d__42[[YfcApp.Pages.Index.EmployeeData, YfcApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Syncfusion.Blazor.Grids.Internal.Selection`1.<RowSelectionClickHandler>d__38[[YfcApp.Pages.Index.EmployeeData, YfcApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Syncfusion.Blazor.Grids.Internal.Selection`1.<ClickHandler>d__35[[YfcApp.Pages.Index.EmployeeData, YfcApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.<CellClickHandler>d__36[[YfcApp.Pages.Index.EmployeeData, YfcApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Syncfusion.Blazor.Grids.Internal.DetailCell`1.<<BuildRenderTree>b__0_0>d[[YfcApp.Pages.Index.EmployeeData, YfcApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)


3 Replies 1 reply marked as answer

VN Vignesh Natarajan Syncfusion Team August 11, 2020 05:21 AM UTC

Hi Zhi,  
 
Thanks for contacting Syncfusion support.  
 
Query: “Collapse the DetailTemplate. Collapse fails and the following message is printed out on the logs: 
 
We have validated the reported issue by preparing a sample as per your suggestion using 18.2.0.48 Syncfusion.Blazor Nuget package. We are able to expand and collapse the detail template without any error. Kindly download the sample which we have prepared from below  
 
 
Kindly ensure the reported issue by clearing the browser cache. And if  you are still facing the issue, share the following details.  
 
  1. Share the Nuget (Syncfusion.Blazor) package version.   
  2. Share the replication procedure of the issue along with video demo.
  3. If possible try to reproduce the reported issue in provided sample and revert back to us.
 
Above requested query will be helpful for us to validate the reported query at our end and provide solution as early as possible.   
 
Regards, 
Vignesh Natarajan 


Marked as answer

ZY Zhi Yuan August 11, 2020 06:54 AM UTC

Hi Vignesh,

Verified that your solution works on 18.2.48. I've also upgraded my version to 18.2.48 (I reported this issue on version 18.2.46) and the issue no longer exists. Apologies, will report issues only after verifying that it exists on the latest version.

Thanks for your assistance!


VN Vignesh Natarajan Syncfusion Team August 12, 2020 04:41 AM UTC

Hi Zhi,  

Thanks for the update 

We are glad to hear that you have resolved your query using our solution.  

Kindly get back to us if you have further queries.  

Regards, 
Vignesh Natarajan  


Loader.
Up arrow icon