Skip to content

Commit e51a335

Browse files
Tsvetomir-HrTsvetomir-Hr
authored andcommitted
chore: polish example and update article content for better seo
1 parent d7aea64 commit e51a335

File tree

1 file changed

+12
-17
lines changed

1 file changed

+12
-17
lines changed

knowledge-base/pdfviewer-upload-controls-visibility.md

Lines changed: 12 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
---
2-
title: Handle Upload Controls Visibility in TelerikPdfViewer
3-
description: Learn how to manage the visibility of upload controls in TelerikPdfViewer when loading a PDF file.
2+
title: How to Hide Upload Component in TelerikPdfViewer
3+
description: Learn how to hide the Upload component in TelerikPdfViewer when loading a PDF file.
44
type: how-to
5-
page_title: How to Control Upload Component Visibility in TelerikPdfViewer
6-
slug: pdfviewer-kb-upload-controls-visibility
7-
tags: pdfviewer, blazor, upload controls, visibility, enableloadercontainer
5+
page_title: How to Hide Upload Component in TelerikPdfViewer
6+
slug: pdfviewer-kb-hide-upload
7+
tags: pdfviewer, blazor, upload, visibility, enableloadercontainer, hide
88
res_type: kb
99
ticketid: 1675214
1010
---
@@ -26,13 +26,13 @@ When using the [TelerikPdfViewer](https://docs.telerik.com/blazor-ui/components/
2626

2727
This knowledge base article also answers the following questions:
2828

29-
- How to prevent interaction with Upload controls while a PDF is loading in TelerikPdfViewer?
29+
- How to prevent interaction with Upload component while a PDF is loading in TelerikPdfViewer?
3030
- How to hide Upload component in TelerikPdfViewer until the PDF file is fully loaded?
31-
- How to use custom CSS with TelerikPdfViewer to manage control visibility?
31+
- How to use custom CSS with TelerikPdfViewer to hide Upload component?
3232

3333
## Solution
3434

35-
To control the visibility of upload controls in the `TelerikPdfViewer` while a PDF is loading, apply custom CSS to hide the upload controls. This can be achieved by leveraging the [`OnOpen`](slug://components/pdfviewer/events#onopen) event to apply a CSS class with the required styles that hide the controls until the PDF file is loaded successfully.
35+
To control the visibility of Upload component in the `TelerikPdfViewer` while a PDF is loading, apply custom CSS to hide the upload controls. To achieve that, use the [`OnOpen`](slug://components/pdfviewer/events#onopen) event to apply a CSS class with the required styles that hide the controls until the PDF file is loaded successfully.
3636

3737
````RAZOR
3838
<TelerikPdfViewer Data="@PdfSource"
@@ -42,11 +42,11 @@ To control the visibility of upload controls in the `TelerikPdfViewer` while a P
4242
Class="@PdfClass">
4343
</TelerikPdfViewer>
4444
<style>
45-
.my-pdf .k-external-dropzone {
45+
.hide-pdf-upload .k-external-dropzone {
4646
display: none;
4747
}
4848
49-
.my-pdf .k-upload {
49+
.hide-pdf-upload .k-upload {
5050
display: none;
5151
}
5252
</style>
@@ -56,13 +56,8 @@ To control the visibility of upload controls in the `TelerikPdfViewer` while a P
5656
5757
private async Task OnPdfOpen(PdfViewerOpenEventArgs args)
5858
{
59-
//hide upload controls
60-
PdfClass = "my-pdf";
61-
}
62-
63-
protected override void OnInitialized()
64-
{
65-
base.OnInitialized();
59+
//hide Upload component
60+
PdfClass = "hide-pdf-upload";
6661
}
6762
}
6863
````

0 commit comments

Comments
 (0)