Skip to main content

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

DxUpload.ReloadAllFiles() Method

In This Article

Reloads all files whose upload was cancelled.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
public void ReloadAllFiles()

#Remarks

Users can reload a file whose upload was canceled in the UI. This action raises the FileReloaded event. If upload of multiple files was cancelled at once, users can click the common reload button to reload of all files.

Upload - Reload a File

Use the ReloadAllFiles method to reload all files in code. The snippet below allows users to upload multiple files, and displays two buttons that cancel upload and reload all files, respectively.

Razor
<DxUpload UploadMode=UploadMode.OnButtonClick
          SelectedFilesChanged="@SelectedFilesChanged"
          AllowMultiFileUpload="true" 
          @ref="MyUpload" >
</DxUpload>

<DxButton Text="Cancel Upload of All Files" Click=OnCancelButtonClick />
<DxButton Text="Reload All Files" Click=OnReloadButtonClick />

@code {
    bool UploadVisible { get; set; } = false;
    IEnumerable<UploadFileInfo> Files { get; set; }
    DxUpload MyUpload { get; set; }

    protected void SelectedFilesChanged(IEnumerable<UploadFileInfo> files) {
        Files = files;
        UploadVisible = files.ToList().Count > 0;

        InvokeAsync(StateHasChanged);
    }

    void OnCancelButtonClick(){
         MyUpload.CancelAllFilesUpload();
    }

    void OnReloadButtonClick(){
         MyUpload.ReloadAllFile();
    }
}  

To reload the specified file or multiple files, use the ReloadFile or ReloadFiles method, respectively.

To cancel file upload in code, use the following methods:

See Also