I upgraded to latest v48 Syncfusion and new .NET Core 5.0.0 release this morning.
Created this page to test the export features of grid and the CSV is not exporting. The command is executing but nothing is showing up at the bottom of my Chrome browser window like the Excel and PDF exports do. Note, Excel and PDF exporting is working fine.
@page "/"
@using Syncfusion.Blazor.Grids
@using Syncfusion.Blazor.Navigations
<div class="col-lg-12 control-section">
<div class="content-wrapper">
<div class="row">
<SfGrid ID="Grid" @ref="Grid" DataSource="@GridData" AllowPaging="true"
Toolbar="@(new List<string>() { "ExcelExport", "CsvExport", "PdfExport" })"
AllowExcelExport="true" AllowPdfExport="true">
<GridEvents OnToolbarClick="ToolbarClick" TValue="OrdersDetails"></GridEvents>
<GridColumns>
<GridColumn Field=@nameof(OrdersDetails.OrderID) HeaderText="Order ID" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.CustomerID) HeaderText="Customer Name" Width="150"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.Freight) HeaderText="Freight" Format="C2" TextAlign="TextAlign.Right" Width="120"></GridColumn>
<GridColumn Field=@nameof(OrdersDetails.ShipCountry) HeaderText="Ship Country" Width="150"></GridColumn>
</GridColumns>
</SfGrid>
</div>
</div>
</div>
@code{
public class OrdersDetails
{
public string OrderID { get; set; }
public string CustomerID { get; set; }
public string Freight { get; set; }
public string ShipCountry { get; set; }
}
SfGrid<OrdersDetails> Grid;
public List<OrdersDetails> GridData { get; set; } = new List<OrdersDetails>();
protected override void OnInitialized()
{
GridData.Add(new OrdersDetails { CustomerID = "cust1", Freight = "Postal", OrderID = "33", ShipCountry = "USA" });
GridData.Add(new OrdersDetails { CustomerID = "cust2", Freight = "UPS", OrderID = "35", ShipCountry = "BRAZIL" });
GridData.Add(new OrdersDetails { CustomerID = "cust3", Freight = "FEDEX", OrderID = "37", ShipCountry = "CANADA" });
GridData.Add(new OrdersDetails { CustomerID = "cust4", Freight = "Postal", OrderID = "99", ShipCountry = "USA" });
}
public void ToolbarClick(Syncfusion.Blazor.Navigations.ClickEventArgs args)
{
if (args.Item.Id == "Grid_pdfexport")
{
this.Grid.PdfExport();
}
if (args.Item.Id == "Grid_excelexport")
{
this.Grid.ExcelExport();
}
if (args.Item.Id == "Grid_csvexport")
{
this.Grid.CsvExport();
}
}
}