Unplanned
Last Updated: 09 Jun 2023 11:31 by Roy
Helmut
Created on: 09 Dec 2022 14:15
Category: PDFViewer
Type: Feature Request
3
Configure the visibility of the "Select files..." button

Please expose a parameter to show or hide the "Select files..." button inside the empty PDF Viewer.

Currently, a possible workaround is to use CSS:

<TelerikButton OnClick="@OnOpenToggle">Toggle Open Buttons</TelerikButton>

<TelerikPdfViewer Data="@PdfSource"
                  Class="@HideOpenClass"
                  Height="400px" />

<style>
    .hide-open .k-blank-page,
    .hide-open .k-button:has(.k-i-folder-open) {
        display: none;
    }
</style>

@code {
    private byte[] PdfSource { get; set; }

    private string HideOpenClass { get; set; } = string.Empty;

    private async Task OnOpenToggle()
    {
        string _hideOpenClass = "hide-open";

        HideOpenClass = HideOpenClass == _hideOpenClass ? string.Empty : _hideOpenClass;
    }
}

1 comment
Roy
Posted on: 09 Jun 2023 11:31

if you don't want users to upload files, the select files button should not be in de contents of the page at all so a user cannot enable it.