Comments (3)
Check RadzenFileUpload. It supports that already.
from radzen-blazor.
maybe I'm missing something super obvious but the existing one only seems to support a single file and requires binding individual properties for file name and file size:
/// <summary>
/// Gets or sets the image file name.
/// </summary>
/// <value>The image file name.</value>
[Parameter]
public string FileName { get; set; }
/// <summary>
/// Gets or sets the FileName changed.
/// </summary>
/// <value>The FileName changed.</value>
[Parameter]
public EventCallback<string> FileNameChanged { get; set; }
/// <summary>
/// Gets or sets the image file size.
/// </summary>
/// <value>The image file size.</value>
[Parameter]
public long? FileSize { get; set; }
/// <summary>
/// Gets or sets the FileSize changed.
/// </summary>
/// <value>The FileSize changed.</value>
[Parameter]
public EventCallback<long?> FileSizeChanged { get; set; }
wouldn't it be more flexible and generic to have the value as List<IBrowserFile> Value
and enable support to toggle multiple file selection? the existing implementation seems to be pretty hardcoded to a single file I've tried this in the examples on the docs page and it doesn't pick up the multiple selected files when I try:
@using RadzenBlazorDemos.Data
@using RadzenBlazorDemos.Models.Northwind
@inherits DbContextPage
<div class="container-fluid">
<div class="row px-3">
<div class="col-lg-6 offset-lg-3 p-3">
<RadzenCard>
<RadzenFileInput @bind-Value=@files TValue="List<IBrowserFile>" class="w-100"
Change=@OnChange Error=@(args => OnError(args, "FileInput")) InputAttributes="@(new Dictionary<string,object>(){ { "aria-label", "select file" }, { "multiple", true }})"/>
</RadzenCard>
</div>
</div>
</div>
<EventConsole @ref=@console />
@code {
List<IBrowserFile> files = new ();
EventConsole console;
string fileName;
long? fileSize;
void OnChange(List<IBrowserFile> value)
{
console.Log($"value: {value?.ToString()} files: {files?.ToString()}");
console.Log($"value: {value?.Count} files: {files?.Count}");
}
void OnError(UploadErrorEventArgs args, string name)
{
console.Log($"{args.Message}");
}
}
from radzen-blazor.
Check the online demos for RadzenFileUpload (the client-side upload).
from radzen-blazor.
Related Issues (20)
- Upload Component: update the online example for the Drag Drop that is misleading - This is NOT a bug
- Radzen.Blazor/RadzenDropDown.razor.cs sample code is having error HOT 3
- Error when clearing dropdown with delete key when DisabledProperty is entered
- RadzenDropDownDataGrid Reset() does not work when Multiple= true
- Feature Request [DataGrid]: In-Cell Editing HOT 2
- DateOnly Query Filtering HOT 5
- Feature Request: [Pager] Refresh button
- InvalidOperationException: Cannot provide a value for property 'DialogService' on type 'Radzen.Blazor.RadzenHtmlEditorSource'. There is no registered service of type 'Radzen.DialogService'. HOT 1
- Feature Request: RadzenDataFilter: Add support for Linq-like filtering
- Feature Request: [DataGrid] Data-based CSS evaluation per-column
- Radzen dropdowndatagrid implement search text clearing cross button
- Feature Request: Add a boolean parameter to open an empty RadzenAutoComplete on focus
- RadzenDropdownDataGrid: Selected values get cleared if component is dynamically generated HOT 1
- datagrid save settings example not-up-to-date HOT 1
- RadzenDropdownDataGrid: Component loses state if component is dynamically created HOT 1
- In RadzenScheduler add public Event OnChangeView when click on Views buttons
- Dropdown with ReadOnly can select all
- Overflow exception on Numeric field when using up/down arrows to increment value HOT 3
- Bug Datagrid composite columns
- Radzen Datagrid not using object's overridden GetHashCode() method HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from radzen-blazor.