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

Adding Title To grid printing


Is it possible to add title to the data grid when using Grid print function? 
The current grid print only allow to either print the current page / whole grid but both has no setting for title

3 Replies

JK Jayaprakash Kamaraj Syncfusion Team April 3, 2017 10:02 AM UTC

Hi Abadi, 

Thanks for contacting Syncfusion support. 

Yes, it is possible to print the grid with header,title and footer. We have achieved your requirement using BeforePrint event of Grid. In this event, we can append the header, title and footer in Grid(printed grid) using below code example, 

    .header { 
        margin-left: 250px; 
        font-family: Calibri; 
        font-size: 35px; 
                .ToolbarSettings(toolbar => 
                    toolbar.ShowToolbar().ToolbarItems(items => 
        .Columns(col => 
            col.Field("OrderID").HeaderText("Order ID").TextAlign(TextAlign.Right).Width(90).Add(); 
            col.Field("CustomerID").HeaderText("Customer ID").Width(90).Add(); 
            col.Field("EmployeeID").HeaderText("Employee ID").TextAlign(TextAlign.Right).Width(80).Add(); 
<script type="text/javascript"> 
    function beforeprint(args) { 
        args.element.append(" <label id='lblFooter' runat='server' class='copyrights'>Copyright © 2001 - 2014 Syncfusion Inc. All Rights Reserved</label>"); 
        args.element.prepend("<label id='lblHeader' runat='server' class='header'>Syncfusion</label>");        



Jayaprakash K. 

AA Andrias Abadi April 3, 2017 04:36 PM UTC

Ok cool thanks! 

JK Jayaprakash Kamaraj Syncfusion Team April 4, 2017 06:14 AM UTC

Hi Abadi,  
Thanks for the update. 
Please get back to us if you need any further assistance.   
Jayaprakash K. 

Live Chat Icon For mobile
Up arrow icon