This is a migrated thread and some comments may be shown as answers.

How to print/not print custom columns from grid?

4 Answers 358 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Krasimir
Top achievements
Rank 1
Krasimir asked on 07 Dec 2017, 12:21 PM

I have to print GridView content but there are some columns that are not needed to be in printed document (for example selection field). How can I make this right?

 

4 Answers, 1 is accepted

Sort by
0
Hristo
Telerik team
answered on 11 Dec 2017, 01:37 PM
Hello Karsimir,

Thank you for writing.

You can hide particular columns in the grid and then set the PrintHiddenColumns property of the GridPrintStyle object to false: https://docs.telerik.com/devtools/winforms/gridview/printing-support/gridprintstyle.

I hope this helps. Let me know if you have other questions.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Krasimir
Top achievements
Rank 1
answered on 12 Dec 2017, 07:52 AM

Hi Hristo,

actually I need the opposite, not to print hidden columns, but those that are not hidden. You see I' writing there "for example selection field". Now you can imagine one useless for print field with check box and possibilite to check/uncheck for some sellection? Of course you can see this field (you must check or uncheck, right?) and no one will want to see on print, if this field is checked or not.

But thank you for the answer anyway. I'll try to do what I need using reports (there are some problems too)

0
Accepted
Hristo
Telerik team
answered on 12 Dec 2017, 11:52 AM
Hi Krasimir,

Thank you for writing back.

If the selection field is actually a GridViewCheckBoxColumn, the cells in this column will be printed as True or False, depending on their actual checked state. Since this might not be wanted you will need to hide the column in the grid to avoid printing it. 

I hope this information was useful. Let me know if you need further assistance.

Regards,
Hristo
Progress Telerik
Try our brand new, jQuery-free Angular components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
0
Krasimir
Top achievements
Rank 1
answered on 12 Dec 2017, 12:24 PM
Yes. This will work. Only I must hide and unhide columns for/after printing. I tought there can be some other way to make this. That's why I post the question hier! :) Thank you, Hristo, anyway! 
Tags
GridView
Asked by
Krasimir
Top achievements
Rank 1
Answers by
Hristo
Telerik team
Krasimir
Top achievements
Rank 1
Share this question
or