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
close icon

Custom Toolbar Item and printGrid possible?


I am running an asp.net website with a grid with an custom toolbar item which calls an javascript in the scriptcontent section for refreshing the grid. When I add the Toolbar item "printGrid", it just makes the same action as the Refresh button. Is there any chance to get this running?

This is a part of the

<ej:Grid ID="Test" runat="server" AllowSelection="True" AllowPaging="True" AllowSorting="True" AllowScrolling="True" AllowFiltering="True" AllowResizeToFit="True">
            <ClientSideEvents ToolbarClick="onToolBarClick" />
            <ToolbarSettings ShowToolbar="True" ToolbarItems="printGrid">


                    <ej:CustomToolbarItem TemplateID="#Refresh" />




and in the scripts section there is:

 <script id="Refresh" type="text/x-jsrender">
        <a class="e-toolbaricons refresh" />

    <script type="text/javascript">

        function onToolBarClick(sender, args) {

....following some code....


So is there any chance to get this printgrid running?

Thank you very much for your help!


2 Replies

MZ Michael Ziegler May 17, 2016 10:25 AM UTC

And another question would be about the size of printGrid function? With standard, it cuts the table... so is it possible to get the full table and resize it within the printer driver?

PK Prasanna Kumar Viswanathan Syncfusion Team May 18, 2016 12:25 PM UTC

Hi Micheal, 

Thanks for contacting Syncfusion support. 


it just makes the same action as the Refresh button” 

To differentiate between print and refresh toolbar icon, we suggest you to check the condition in the toolbarClick event. In this event we were able to get the itemName in the arguments and refresh the grid.   

Please find the code example: 

function onToolBarClick(sender) { 
            if(sender.itemName == "Refresh") 

“is it possible to get the full table and resize it within the printer driver? 

We were able to reproduce the mentioned issue when we enable the allowScrolling in the sample. So, a support incident has been created under your account to track the status of this requirement. Please log on to our support website to check for further updates.    

Prasanna Kumar N.S.V 

Live Chat Icon For mobile
Up arrow icon