Excel Filter not working, error on button click
Hi, I'm having this issue when trying to user blazor server Grid with the default template in the FetchData page

I assigned forecasts to the grid's datasource and enable the excel filter on the grid.
When i click the button on any column i get an error.
I'm using latest nuget package.
Search function is working fine
The code i used for the grid is this
<SfGrid TValue="object" AllowReordering="true" DataSource="forecasts" AllowPaging="true" AllowFiltering="true" AllowExcelExport="true" Toolbar=@Tool>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel"></GridFilterSettings>
<GridEvents TValue="object" OnActionFailure="@ActionFailure"></GridEvents>
<GridColumns>
<GridColumn Field="Date" HeaderText="Date" Type="ColumnType.String" Width="120"></GridColumn>
<GridColumn Field="Summary" HeaderText="Summary" Type="ColumnType.String" Width="120"></GridColumn>
<GridColumn Field="TemperatureC" HeaderText="TemperatureC" Type="ColumnType.String" Width="120"></GridColumn></GridColumns>
</SfGrid>
SIGN IN To post a reply.
1 Reply
1 reply marked as answer
VN
Vignesh Natarajan
Syncfusion Team
April 2, 2021 03:21 AM UTC
Hi Ulises,
Thanks for contacting Syncfusion support.
Query: “I'm having this issue when trying to user blazor server Grid with the default template in the FetchData page”
We have analyzed the reported issue by preparing the sample as per your suggestion and code example. We are able to reproduce the reported issue at our end also. This is because TValue of Grid is defined wrongly, generic class must be specified as TValue to perform DataOperations properly. Refer the below modified code example.
|
<SfGrid TValue="WeatherForecast" AllowReordering="true" DataSource="forecasts" AllowPaging="true" AllowFiltering="true" AllowExcelExport="true" Toolbar=@(new List<string>() { "Search" })>
<GridFilterSettings Type="Syncfusion.Blazor.Grids.FilterType.Excel"></GridFilterSettings>
<GridEvents TValue="WeatherForecast" OnActionFailure="@ActionFailure"></GridEvents>
<GridColumns>
<GridColumn Field="Date" HeaderText="Date" Type="ColumnType.String" Width="120"></GridColumn>
<GridColumn Field="Summary" HeaderText="Summary" Type="ColumnType.String" Width="120"></GridColumn>
<GridColumn Field="TemperatureC" HeaderText="TemperatureC" Type="ColumnType.String" Width="120"></GridColumn>
</GridColumns>
</SfGrid> |
For your convenience we have prepared a sample which can be downloaded from below
If datasource type is now known or generic, then we suggest you to bind the datasource using ExpandoObject or DynamicObject. Refer our UG documentation for your reference
Please get back to us if you have further queries.
Regards,
Vignesh Natarajan
Marked as answer
SIGN IN To post a reply.