Welcome to the Blazor feedback portal. We’re happy you’re here! If you have feedback on how to improve the Blazor, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
Requirement: After uploaded the file, need to clear the list using clearAll method and then reload it from their API.
Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/Blazor_upload-1661538746
Replication procedure:
1. Run the above sample.
2. Upload any file.
3. Actual: The file get cleared, but not updated again using files property
<SfUploader @ref="UploaderObj" ID="UploadFiles" DropArea="#dropArea" MinFileSize="100" MaxFileSize="1000000" Files="@UploaderFiles">
<UploaderEvents ValueChange="OnChangeAsync"></UploaderEvents>
<UploaderTemplates>
<Template>
<span class="wrapper">
<img class="upload-image" alt="Image">
</span>
<div class="name file-name graytext" title="@((context as FileInfo).Name)">@((context as FileInfo).Name)</div>
<div class="file-size">@(context.Size)</div>
<span class="e-icons e-file-remove-btn remove" id="removeIcon" title="Remove"></span>
</Template>
</UploaderTemplates>
</SfUploader>
@code
{
public List<UploaderUploadedFiles> UploaderFiles { get; set; }
public SfUploader UploaderObj { get; set; }
public async Task OnChangeAsync(UploadChangeEventArgs args)
{
UploaderObj.ClearAll();
UploaderFiles = new List<UploaderUploadedFiles>() { new UploaderUploadedFiles() { Name = "tata", Size = 100, Type = ".png" } };
}
}