Cast error in Datagrid

Hi, I am using version 18.4.0.48 with Wasm project...

When I set Property FrozenColumns in Datagrid with AllowGrouping = true, I get one exception (see below...)
When I don´t use the FrozenColumns property there is no error and it works fine.


My code...

 <SfGrid @ref="gridConsulta"
                                            DataSource="@dataSourceDTO"
                                            FrozenColumns="4"
                                            ShowColumnChooser="true"
                                            AllowPaging="false"
                                            AllowSorting="true"
                                            AllowFiltering="true"
                                            AllowGrouping="true"
                                            Width="auto"
                                            RowHeight="20" Height="400"
                                            AllowSelection="true"
                                            AllowExcelExport="true"
                                            AllowReordering="true">
                                        <GridEditSettings AllowEditing="false"></GridEditSettings>
                                        <GridEvents TValue="ExpedienteColumnDataDTO" 
                                                    RowDataBound="GridTicketsRowBound"></GridEvents>
                                        <GridColumns>
...

I get this exception

blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Specified cast is not valid.
System.InvalidCastException: Specified cast is not valid.
   at Syncfusion.Blazor.Grids.Internal.GridRowBase`1.<OnParametersSetAsync>d__50[[WEBAPI.Shared.ExpedienteColumnDataDTO, WEBAPI.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
d.printErr @ blazor.webassembly.js:1
2blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Object reference not set to an instance of an object.
System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.Grids.Internal.PropertyInfoHelper.CreateAccessor(PropertyInfo propertyInfo)
   at Syncfusion.Blazor.Grids.Internal.PropertyInfoHelper.GetAccessor(String name, IDictionary`2 cache, Object from)
   at Syncfusion.Blazor.Grids.Internal.PropertyInfoHelper.GetFieldValue(String nameSpace, Object from, IDictionary`2 cache)
   at Syncfusion.Blazor.Grids.Internal.PropertyInfoHelper.GetObject(String nameSpace, Object from)
   at Syncfusion.Blazor.Grids.Internal.GridCellBase`1[[WEBAPI.Shared.ExpedienteColumnDataDTO, WEBAPI.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].GetValue()
   at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.<OnParametersSetAsync>d__28[[WEBAPI.Shared.ExpedienteColumnDataDTO, WEBAPI.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()
d.printErr @ blazor.webassembly.js:1
blazor.webassembly.js:1 crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100]
      Unhandled exception rendering component: Specified cast is not valid.
System.InvalidCastException: Specified cast is not valid.
   at Syncfusion.Blazor.Grids.Internal.GridCellBase`1.<OnParametersSetAsync>d__28[[WEBAPI.Shared.ExpedienteColumnDataDTO, WEBAPI.Shared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]].MoveNext()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.ComponentBase.RunInitAndSetParametersAsync()

Please help!


1 Reply 1 reply marked as answer

RN Rahul Narayanasamy Syncfusion Team March 23, 2021 12:58 PM UTC

Hi Jose, 

Greetings from Syncfusion. 

Query: Cast error in Datagrid - When I set Property FrozenColumns in Datagrid with AllowGrouping = true, I get one exception (see below...) When I don´t use the FrozenColumns property there is no error and it works fine. 

We have validated your query and you are facing problem while using Grid frozen columns feature with Grouping. We would like to inform you that the Grouping feature is not supported with frozen rows and columns feature. 

Find the below documentation link for your reference. 

Reference: 

Please let us know if you have any concerns. 

Regards, 
Rahul 


Marked as answer
Loader.
Up arrow icon