From 97ba3a24dba7c0d965056e415aea4cdf42b78d6b Mon Sep 17 00:00:00 2001 From: Naveen-Palanivel <103498545+Naveen-Palanivel@users.noreply.github.com> Date: Fri, 28 Aug 2026 14:20:10 +0530 Subject: [PATCH] 1049732 : Change row height in the Grid exported file Added a new topic in Grid excel export Change row height in the Grid exported file using memory stream --- .../blazor/data-grid/excel-export-options.md | 113 ++++++++++++++++++ 1 file changed, 113 insertions(+) diff --git a/grid-sdk/blazor/data-grid/excel-export-options.md b/grid-sdk/blazor/data-grid/excel-export-options.md index 4e439b1b4..27c0a79dd 100644 --- a/grid-sdk/blazor/data-grid/excel-export-options.md +++ b/grid-sdk/blazor/data-grid/excel-export-options.md @@ -1896,6 +1896,119 @@ This method is helpful when the exported **Excel** file needs to support data an } +{% endhighlight %} + +{% highlight c# tabtitle="Javascript.js" %} + +function saveAsFile(filename, bytesBase64) { + var link = document.createElement('a'); + link.download = filename; + link.href = "data:application/octet-stream;base64," + bytesBase64; + document.body.appendChild(link); + link.click(); + document.body.removeChild(link); +} + +{% endhighlight %} +{% endtabs %} + +### Change row height in exported file + +The Blazor Data Grid can export data as a memory stream, allowing modification of the Excel workbook before the exported file is delivered to the client. Using the [XlsIO](https://www.nuget.org/packages/Syncfusion.XlsIO.Net.Core/) library, worksheet formatting can be customized programmatically during the export process. + +The [SetRowHeightInPixels](https://help.syncfusion.com/cr/document-processing/Syncfusion.XlsIO.IWorksheet.html#Syncfusion_XlsIO_IWorksheet_SetRowHeightInPixels_System_Int32_System_Double_) method is used to modify the height of a specific row in the exported Excel file by providing the row index and the required height in pixels. This enables row-level customization in the exported workbook. + +In the following example, an [SfNumericTextBox](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.SfNumericTextBox-1.html) component is used to specify the Excel row index dynamically. The selected value is updated through the [ValueChange](https://help.syncfusion.com/cr/blazor/Syncfusion.Blazor.Inputs.NumericTextBoxEvents-1.html#Syncfusion_Blazor_Inputs_NumericTextBoxEvents_1_ValueChange) event and stored in the NumericValue property. During the Excel export operation, the value of NumericValue is passed to the `SetRowHeightInPixels` method, allowing the height of the corresponding row in the exported Excel document to be modified. In this sample, the height of the specified row is set to **100** pixels. + +{% tabs %} +{% highlight razor tabtitle="Index.razor" %} + +@using Syncfusion.Blazor.Grids +@using System.IO +@using Syncfusion.XlsIO +@inject IJSRuntime JSRuntime +@using Syncfusion.Blazor.Inputs + +