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

Hide Gridview in print screen

4 Answers 89 Views
Panel
This is a migrated thread and some comments may be shown as answers.
fazera
Top achievements
Rank 1
fazera asked on 29 Mar 2020, 02:17 PM

Hi everyone, i need some ideas. Currently I implement print screen into my project. So print button will print all the content in my page. I set up all the content in one panel which is 'mainPanel'. In my 'mainPanel' there have gridview. How can I hide this gridview when I print screen the page? Here I attach the image for the page.

 

Thank you.

4 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 01 Apr 2020, 11:13 AM
Hello, Fazera,

According to the provided information, it is not clear what is the exact printing implementation that you have on your end. Hence, it wouldn't be easy to suggest an appropriate solution.

Usually, in order to hide a certain control, you just need to set its Visible property to false. Thus, the control will remain present on the form, but it will be invisible to the end users. 

I would recommend you to have a look at the following help article which demonstrates a sample approach how to create printable panel: https://docs.telerik.com/devtools/winforms/telerik-presentation-framework/printing-support/how-to/create-prinatble-panel 

I hope this information helps. If you need any further assistance please don't hesitate to contact me. 

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
fazera
Top achievements
Rank 1
answered on 02 Apr 2020, 03:26 AM

Thank you Dess for replying.

Im using radprintdocument. Here is the snap code for print function and the printing result. I want to hide the gridview when print the whole content in the page.  Curently in my user control, I have one mainpanel which include the gridview. As you can see in the code, I print the whole content in my main panel. So its include my grid view. How to hide this grid view ? I just want user view the grid view when load the page. I do not want to print this gridview.

0
Accepted
Dess | Tech Support Engineer, Principal
Telerik team
answered on 06 Apr 2020, 11:48 AM
Hello, Fazera,  

I would kindly ask you to use the "Format Code Block" option in the editor when you want to insert some code snippet. Thus, we would be able to test on our end any code that you provide. 

As it was previously explained, you just need to set the Visible property to false for RadGridView before printing and make it back visible when the printing is done. 
An alternative solution is to arrange the controls in your UserControl in a different way. Thus, you can put all controls that you want to print in a separate RadPanel. Thus, you can make only this RadPanel a PrintablePanel. As a result, the RadGridView will not be contained in this panel and it won't be printed as well.

Should you have further questions please let me know.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
fazera
Top achievements
Rank 1
answered on 06 Apr 2020, 01:33 PM
Thank you Dess for explaining more details. Now, it works!
Tags
Panel
Asked by
fazera
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
fazera
Top achievements
Rank 1
Share this question
or