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

Cancelling the loading

5 Answers 173 Views
PdfViewer and PdfViewerNavigator
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 15 Jul 2019, 03:11 PM

Hi!

Is there a way to cancel a loading because I have issues with loading certain files (big or complex one) and trying to load others files while is loading is just worst.

Thanks!

5 Answers, 1 is accepted

Sort by
0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 16 Jul 2019, 05:55 AM
Hello, Simon,  

RadPdfViewer offers an option for unloading documents which may be suitable for your scenario. It is just necessary to call the RadPdfViewer.UnloadDocument method. 

However, I would recommend you to have a look at the following help article where it is demonstrated how to show a waiting bar while a large document is being loaded: https://docs.telerik.com/devtools/winforms/controls/pdfviewer/how-to/handle-rendering-events

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simon
Top achievements
Rank 1
answered on 16 Jul 2019, 01:28 PM

Hi Dess,

Thanks for the reply.  I'm already unloading the document before each time i'm trying to load another one.  There's already a waiting bar (seems out of the box) that is shown but we don't want to prevent the user to try loading something else and stop waiting for the big document to load.

Cheers,

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 17 Jul 2019, 12:49 PM
Hello, Simon,  

There isn't a suitable public API for aborting the load operation of a document that is currently being loaded in RadPdfViewer. I have tested calling the UnloadDocument method. It seems to instantly unload the document. But if you use the approach for showing a waiting bar while the document is being loaded, please ensure that the waiting bar is stopped before unloading the document:

this.radPdfViewer1.PdfViewerElement.StopWaiting();
this.radPdfViewer1.PdfViewerElement.UnloadDocument();

I hope that this approach may be applicable for your scenario.

Regards,
Dess | Tech Support Engineer, Sr.
Progress Telerik
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
0
Simon
Top achievements
Rank 1
answered on 26 Jul 2019, 01:59 PM

Hi Dess,

Sorry for the delay.  It did not work (asking for many unloaddocument/loaddocument(filepath) result in having the exception File is closed) so I will block the user from asking document to load document until the current one it loaded. The list of file are in a RadGridView.  The only problem I got left is that whenever I put the grid to enabled = false, I got the grid color to change to grey.  Is there a way to prevent the color change?

Thanks!

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 26 Jul 2019, 02:08 PM
Hello, Simon,   

When you disable a certain control, it is absolutely normal that it gets gray. This is valid for the standard MS WinForms controls as well.

A possible solution that I can suggest in order avoid such a gray look, is to set the GridViewElement.UseDefaultDisabledPaint property to false and manipulate the GridViewElement.Enabled property instead of setting the Enabled property of RadGridView.

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
Get quickly onboarded and successful with your Telerik and/or Kendo UI products with the Virtual Classroom free technical training, available to all active customers. Learn More.
Tags
PdfViewer and PdfViewerNavigator
Asked by
Simon
Top achievements
Rank 1
Answers by
Dess | Tech Support Engineer, Principal
Telerik team
Simon
Top achievements
Rank 1
Share this question
or