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.
Unfortunately, activation email could not send to your email. Please try again.

Custom Toolbar Item and printGrid possible?

Thread ID:

Created:

Updated:

Platform:

Replies:

124102 May 17,2016 06:24 AM May 18,2016 08:25 AM ASP.NET Web Forms 2
loading
Tags: Grid
Michael Ziegler
Asked On May 17, 2016 06:24 AM

Hi,

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">
          

                <CustomToolbarItem>

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

                </CustomToolbarItem>

            </ToolbarSettings>

[...]

and in the scripts section there is:

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

    <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!

Michael

Michael Ziegler
Replied On May 17, 2016 06:25 AM

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?

Prasanna Kumar Viswanathan [Syncfusion]
Replied On May 18, 2016 08:25 AM

Hi Micheal, 

Thanks for contacting Syncfusion support. 

      Queries 
                                       Response 

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") 
                this.refreshContent(); 
        } 



“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.    
 
 


Regards, 
Prasanna Kumar N.S.V 


CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;