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.

Remove Columns in PDF Export

Thread ID:

Created:

Updated:

Platform:

Replies:

105202 Sep 17,2012 04:34 PM Sep 18,2012 03:27 AM ASP.NET MVC (Classic) 1
loading
Tags: Grid
Stefan Onken
Asked On September 17, 2012 04:34 PM

Hi,
 
I want to remove some columns that are visible in the Grid, so that they do not appear in the exported pdf. Is this possible?
 
Regards, Stefan

Eswari S [Syncfusion]
Replied On September 18, 2012 03:27 AM

Hi Stefan,

Thank you for using Syncfusion products.

Query #: Remove Columns in PDF Export

splice() method adds/removes items to/from an array, and returns the removed item. In exporting , we have remove the specified column from VisibleColumns collection and after exporting we have restored the column into the grid using setTimeout function in OnToolbarClickEvent. Please refer to the following code snippets:

function begin(sender, args) {
            var gridObj = $find("SampleGrid");
            var visible = gridObj.get_VisibleColumns();
 
            window.tempDelete = [visible, visible.splice(0, 1)];
 
            window.setTimeout(function () {
 
                window.tempDelete[0].splice(0, 0, window.tempDelete[1][0]);
 
            }, 0);
        }

We have prepared the sample for your requirement and the same can be downloaded from the following link:

http://www.syncfusion.com/downloads/Support/DirectTrac/95502/Sample1852111117.zip

Please try this and let us know if you have any other queries.

Regards,
Eswari S


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.

;