Duplicated
Last Updated: 08 Feb 2024 08:52 by ADMIN
Oliver
Created on: 06 Feb 2024 12:36
Category: UI for Blazor
Type: Bug Report
2
TelerikPdfViewer cannot render when inside an EditForm.

The following code successfully renders the pdf viewer when the edit form is commented out, but when indside the pdf viewer it fails to render and gives the following error:

"Telerik.Blazor.Components.TelerikComboBox`2[Telerik.Blazor.Components.PdfViewer.Models.PdfViewerZoomLevelDescriptor,System.String] requires a value for the 'ValueExpression' ValueExpression is provided automatically when using 'bind-Value'.See more at https://docs.telerik.com/blazor-ui/knowledge-base/requires-valueexpression ."

 

 

@page "/pdfBug" @* <EditForm Model="_fakeContext"> *@ <TelerikPdfViewer Data="@PdfSource" OnDownload="@OnPdfDownload" Height="600px"></TelerikPdfViewer> @* </EditForm> *@ @code { private byte[] PdfSource { get; set; } private async Task OnPdfDownload(PdfViewerDownloadEventArgs args) { args.FileName = "PDF-Viewer-Download"; } protected override void OnInitialized() { PdfSource = Convert.FromBase64String(PdfBase64); base.OnInitialized(); } private const string PdfBase64 = "JVBERi0xLjEKMSAwIG9iajw8L1R5cGUvQ2F0YWxvZy9QYWdlcyAyIDAgUj4+ZW5kb2JqCjIgMCBvYmo8PC9UeXBlL1BhZ2VzL0tpZHNbMyAwIFJdL0NvdW50IDEvTWVkaWFCb3ggWy00MCAtNjQgMjYwIDgwXSA+PmVuZG9iagozIDAgb2JqPDwvVHlwZS9QYWdlL1BhcmVudCAyIDAgUi9SZXNvdXJjZXM8PC9Gb250PDwvRjE8PC9UeXBlL0ZvbnQvU3VidHlwZS9UeXBlMS9CYXNlRm9udC9BcmlhbD4+ID4+ID4+L0NvbnRlbnRzIDQgMCBSPj5lbmRvYmoKNCAwIG9iajw8L0xlbmd0aCA1OT4+CnN0cmVhbQpCVAovRjEgMTggVGYKMCAwIFRkCihUZWxlcmlrIFBkZlZpZXdlciBmb3IgQmxhem9yKSBUagpFVAplbmRzdHJlYW0KZW5kb2JqCnhyZWYKMCA1CjAwMDAwMDAwMDAgNjU1MzUgZgowMDAwMDAwMDIxIDAwMDAwIG4KMDAwMDAwMDA4NiAwMDAwMCBuCjAwMDAwMDAxOTUgMDAwMDAgbgowMDAwMDAwNDkwIDAwMDAwIG4KdHJhaWxlciA8PCAgL1Jvb3QgMSAwIFIgL1NpemUgNSA+PgpzdGFydHhyZWYKNjA5CiUlRU9G"; private FakeContext _fakeContext = new FakeContext() { Name = "Test" }; public class FakeContext { public string Name { get; set; } } }


Duplicated
This item is a duplicate of an already existing item. You can find the original item here:
0 comments