[PR #1680] Improved FileInput Image Preview Rendering #2861

Closed
opened 2026-01-29 18:20:47 +00:00 by claunia · 0 comments
Owner

Original Pull Request: https://github.com/radzenhq/radzen-blazor/pull/1680

State: closed
Merged: Yes


The RadzenFileInput component has support for byte[] in addition to the default of string, however when using byte[] the image preview would not display correctly as it would just reference Value directly for the src attribute of the preview img. This would result in something like the following:
CleanShot 2024-09-07 at 09 39 53

To address this I have added a new private get only property that will decode the Value if the TValue is of byte[]. This results in the image preview behaving normally eg:
CleanShot 2024-09-07 at 11 28 17

Additionally I have added a corresponding demo to the FileInput Demos to highlight this usage.

Pleases let me know if additional changes are required. I tried to keep things aligned style wise where I could and as this is my first PR on this project any feedback would be appreciated 😄

**Original Pull Request:** https://github.com/radzenhq/radzen-blazor/pull/1680 **State:** closed **Merged:** Yes --- The RadzenFileInput component has support for `byte[]` in addition to the default of `string`, however when using `byte[]` the image preview would not display correctly as it would just reference Value directly for the src attribute of the preview img. This would result in something like the following: ![CleanShot 2024-09-07 at 09 39 53](https://github.com/user-attachments/assets/255da44a-6263-430b-a7b8-4eee19389b3e) To address this I have added a new private get only property that will decode the Value if the TValue is of `byte[]`. This results in the image preview behaving normally eg: ![CleanShot 2024-09-07 at 11 28 17](https://github.com/user-attachments/assets/f5f01bf6-a34c-43c4-9efd-c385034ed74a) Additionally I have added a corresponding demo to the FileInput Demos to highlight this usage. Pleases let me know if additional changes are required. I tried to keep things aligned style wise where I could and as this is my first PR on this project any feedback would be appreciated 😄
claunia added the pull-request label 2026-01-29 18:20:47 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: starred/radzen-blazor#2861