We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

Max lines pdf and excel grid export


How can I define a maximum number of grid lines to export to PDF and Excel files? I'm using AllowPaging="true" and ODataV2Adaptor in the grid.



1 Reply

NP Naveen Palanivel Syncfusion Team March 30, 2023 09:07 PM UTC

Hi Erick,

We checked your query and we have already discussed about this  similar topics detailly in our UG documentation. Kindly refer the documentation link shared.

Link : https://blazor.syncfusion.com/documentation/datagrid/pdf-export#custom-data-source


private SfGrid<Order> DefaultGrid;

    public List<Order> Orders { get; set; }


    public async Task ToolbarClickHandler(Syncfusion.Blazor.Navigations.ClickEventArgs args)


        if (args.Item.Id == "Grid_pdfexport"//Id is combination of Grid's ID and itemname


            PdfExportProperties PdfProperties = new PdfExportProperties();

            PdfProperties.DataSource = Orders.Take(10).ToList();  //Here you can customize your count

            await this.DefaultGrid.PdfExport(PdfProperties);



    protected override void OnInitialized()


        Orders = Enumerable.Range(1, 75).Select(x => new Order()


                OrderID = 1000 + x,

                CustomerID = (new string[] { "ALFKI", "ANANTR", "ANTON", "BLONP", "BOLID" })[new Random().Next(5)],

                Freight = 2.1 * x,

                OrderDate = DateTime.Now.AddDays(-x),




Please let us know if you have any concerns.


Naveen Palanivel

Live Chat Icon For mobile
Up arrow icon