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. (Last updated on: June 24, 2019).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Grid Export PDF functionality does not seem to work with rowtemplate

Thread ID:

Created:

Updated:

Platform:

Replies:

146756 Aug 18,2019 04:09 AM UTC Aug 19,2019 12:18 PM UTC ASP.NET Core - EJ 2 2
loading
Tags: DataGrid
ajit goel
Asked On August 18, 2019 04:09 AM UTC

I have the following code. The "Download PDF" button works but it returns only one "ID" column(which is a width=0 column). How can I make it honor the grid rowtemplate?
i am also not able to provide a running row number for a column with the Grid rowtemplate using the queryCellinfo event.
Please help.
rowTemplate="#rowtemplate"
allowPaging="true" allowPdfExport="true" toolbarClick="toolbarClick"
toolbar="@( new List<object> {"PdfExport"})" queryCellInfo="queryCellInfo">
function toolbarClick(args)
{
var gridObj = document.getElementById("SocialMediaAccountDetails").ej2_instances[0];
if (args.item.id === 'SocialMediaAccountDetails_pdfexport')
{
var exportProperties = {fileName: "tweets.pdf"};
gridObj.pdfExport(exportProperties);
}
}
var count = 1;
function queryCellInfo(args) {
if (args.column.headerText == "Row Number") {
args.cell.innerHTML = count;
count++;
}
}

ajit goel
Replied On August 18, 2019 04:14 AM UTC

I have the following code. The "Download PDF" button works but it returns only one "ID" column(which is a width=0 column). How can I make it honor the grid rowtemplate?
i am also not able to provide a running row number for a column with the Grid rowtemplate using the queryCellinfo event.
Please help.
rowTemplate="#rowtemplate"
allowPaging="true" allowPdfExport="true" toolbarClick="toolbarClick"
toolbar="@( new List<object>() {"PdfExport"})" queryCellInfo="queryCellInfo">
function toolbarClick(args)
{
var gridObj = document.getElementById("SocialMediaAccountDetails").ej2_instances[0];
if (args.item.id === 'SocialMediaAccountDetails_pdfexport')
{
var exportProperties = {fileName: "tweets.pdf"};
gridObj.pdfExport(exportProperties);
}
}
var count = 1;
function queryCellInfo(args) {
if (args.column.headerText == "Row Number") {
args.cell.innerHTML = count;
count++;
}
}

Please close this item. 

Dhivya Rajendran [Syncfusion]
Replied On August 19, 2019 12:18 PM UTC

Hi Ajit,  
  
Thanks for contacting us.   
    
We have already provided response for the query in forum #146757. Please check that forum for more information. 
  
Regards,  
R.Dhivya  


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.

Please sign in to access our forum

This page will automatically be redirected to the sign-in page in 10 seconds.

Warning Icon 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.Close Icon

Live Chat Icon For mobile
Live Chat Icon