Hi Jason,
Greetings from Syncfusion support.
Based on this scenario, we suggest you to ensure to assign the custom HeaderTemplate content to args.Cell.Value inside the ExcelHeaderQueryCellInfoEvent event handler to display the custom header texts in exported file. Please refer and use as like the code below,
|
<GridEvents OnToolbarClick="ToolbarClickHandler" ExcelHeaderQueryCellInfoEvent="ExcelHeaderQueryCellInfoEvent" TValue="Order"></GridEvents>
<HeaderTemplate>
<div>Custom Header Text for OrderID</div>
</HeaderTemplate>
</GridColumn>
public void ExcelHeaderQueryCellInfoEvent(ExcelHeaderQueryCellInfoEventArgs args)
{
if (args.Column.Field.Equals("OrderID"))
{
//assign your custom header template content here
args.Cell.Value = "Custom Header Text for OrderID";
}
}
|
We are also attaching the sample for your reference, kindly download and refer the sample form the link below,
Please get back to us if you need further assistance.
Regards,
Renjith R