We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

File Uploader OnFileListRenderHandler does not work

Hi, I am having trouble getting the OnFileListRenderHandler event to work. I have reduced my code down to the following but the problem is that the event handler never gets called. Please can you help?  I am using v20.4.0.44.  Thanks, Mike.

@using Syncfusion.Blazor.Inputs

<SfUploader AutoUpload="true" AllowMultiple="true" MaxFileSize="500000" AllowedExtensions=".json">
    <UploaderEvents OnFileListRender="OnFileListRenderHandler"></UploaderEvents>
    <UploaderButtons Browse="Browse for files..."/>
</SfUploader>
 
@code {
    private void OnFileListRenderHandler(FileListRenderingEventArgs args)
    {
        Console.WriteLine("OnFileListRenderHandler");
        // Here, you can customize your code.
    }
}

3 Replies

SP Sureshkumar P Syncfusion Team January 25, 2023 10:58 AM UTC

Hi Mike,

This is the default behavior of our uploader component, the OnFileListRendering is applicable for the AsyncSetting cases alone. So, we suggest you use the AssyncSettings property to trigger the OnFileListRendering event.

Find the code example here:

<SfUploader ID="uploader">

    <UploaderAsyncSettings SaveUrl=https://aspnetmvc.syncfusion.com/services/api/uploadbox/Save RemoveUrl=https://aspnetmvc.syncfusion.com/services/api/uploadbox/Remove></UploaderAsyncSettings>

    <UploaderEvents OnFileListRender="OnFileListRenderHandler"></UploaderEvents>

</SfUploader>

 

@code {

    private void OnFileListRenderHandler(FileListRenderingEventArgs args)

    {

        Console.WriteLine("OnFileListRenderHandler");

        // Here, you can customize your code.

    }

}

 


Regards,

Sureshkumar P



MF Mike Freeman January 26, 2023 10:22 AM UTC

Hi Sureshkumar,


Thanks - could I suggest that you update your documentation to specify which events are only applicable when using the AsyncSettings.


Kind regards,


Mike.




SP Sureshkumar P Syncfusion Team January 27, 2023 09:16 AM UTC

Mike, thanks for your valuable suggestion, we have logged “Need to update the documentation for the event support information on uploader” as a documentation correction request, and this support will be included in any one of our upcoming releases.


Loader.
Up arrow icon