Change or add a text header to print function in the Grid

If is possible to add or customize a header text when we print in the Datagrid.

I see a text on the top of the grid with the Grid name on it, and we could also change the value.


Regards,


1 Reply

RR Rajapandi Ravi Syncfusion Team October 20, 2021 01:18 PM UTC

Hi Arsenio, 

Greetings from Syncfusion support 

From your update, we suspect that you like to add your title in the header. You can add your title in the header through a beforePrint event. With the help of this event, you can add your title element as you want. We have already discussed about your requirement in our documentation. Please refer the below documentation for more information. 


Also, we suspect that you like to change the headerText of the Grid header while printing. You can achieve this requirement by using beforePrint event of Grid. Please refer the below code example and sample for more information. 
 
 
<script> 
    function beforePrint(args) { //beforePrint event 
        args.element.querySelector('.e-headercontent').querySelectorAll('th')[1].innerText = "Set your header text here" 
    } 
</script> 




Screenshot: 

 

Regards, 
Rajapandi R 


Loader.
Up arrow icon