
Table Export
By setting ShowExportButton
to display the export button, the component has built-in export Excel function
The export function provides an export callback method OnExportAsync
, which can be used to export data by providing a custom export method. If no data export method is provided, the component will export data according to the injected export service
BootstrapBlazor.TableExport
, which needs to reference its component package when using this componentBootstrapBlazor.TableExport
componentdotnet add package BootstrapBlazor.TableExport
<PackageReference Include="BootstrapBlazor.TableExport" Version="7.3.0" />
Install-Package BootstrapBlazor.TableExport
inject service:
public void ConfigureServices(IServiceCollection services)
{
// Add BootstrapBlazor component
services.AddBootstrapBlazor();
// Add Table Excel export service
services.AddBootstrapBlazorTableExcelExport();
}
Whether to display the export button by setting the ShowExportButton
property, the default is false
Demo
You can customize the export method by setting the OnExportAsync
callback delegate method. If you don't set it, the built-in export function of the component will be used.
Demo
Customize the content of the export button dropdown box by setting the ExportButtonDropdownTemplate
template
Demo
B station related video link
交流群