hide all grid but allowed to download excel

Hello, im my application, i created list of history purchase without using sfGrid.

But i want to download my history data with sfgrid excel download capabilities.

how can i download to excel with sfgrid feature, but all the sfgrid are hidden from UI. 

Attachment: Visible_SFGrid_493b0e85.rar

3 Replies 1 reply marked as answer

JP Jeevakanth Palaniappan Syncfusion Team April 26, 2021 12:14 PM UTC

Hi Indra, 

Greetings from Syncfusion support. 

We have validated your query and we suggest you to export the grid by invoking the ExcelExport method of the grid by using a button click. Please refer the  below code snippet, sample and documentation for your reference. 

<Syncfusion.Blazor.Buttons.SfButton Content="Excel" @onclick="ExcelExport"></Syncfusion.Blazor.Buttons.SfButton> 
 
<SfGrid ID="Grid" @ref="DefaultGrid" DataSource="@Orders" AllowSorting="true" Toolbar="@(new List<string>() { "ExcelExport" })" AllowExcelExport="true" AllowPaging="true"> 
     
</SfGrid> 
 
<style> 
    #Grid { 
    display: none; 
    } 
</style> 
 
@code{ 
    private SfGrid<Order> DefaultGrid; 
 
    public async Task ExcelExport() { 
        await this.DefaultGrid.ExcelExport(); 
    } 
 
} 



Regards, 
Jeevakanth SP. 


Marked as answer

IN Indra April 26, 2021 11:33 PM UTC

Thank You! it solved my problem


JP Jeevakanth Palaniappan Syncfusion Team April 27, 2021 05:26 AM UTC

Hi Indra, 

We are glad that the provided solution resolved your problem. Please get back to us if you have any other queries. 

Regards, 
Jeevakanth SP. 


Loader.
Up arrow icon