Is there a way to refresh file manager from the code?

I have a file manager component on a page and there's a possibility that multiple users can be working on it at the same time. I know that they can click on the refresh button as part of the toolbar to refresh the content and see any changes made by another user but is there a way this can be done from the code? 

I tried using RefreshFileAsync but it doesn't do anything except stay in an infinite loop. 

I am planning on using signalr for sending the signal from the fileattachcontroller but I need a way to use the refresh capability inside the toolbar from the code. Please let me know if this is possible.


1 Reply 1 reply marked as answer

JA Jafar Ali Shahulhameed Syncfusion Team October 2, 2025 10:54 AM UTC

Hi Nick,


From your provided details we can understand that you are trying to refresh the files in File Manager component by utilizing the RefreshFilesAsync public method.


We would like to inform you that both Refresh button in Toolbar and RefreshFilesAsync have similar behavior. To achieve refreshing the files in code level using public method kindly refer the below changes,


<div class="control-section">

    <SfButton OnClick="refresh">RefreshFile</SfButton>

    @* Initialization of default File Manager component *@

    <SfFileManager @ref="file" TValue="FileManagerDirectoryContent”>

    …

    …

    </SfFileManager>

</div>

 

@code {

    private SfFileManager<FileManagerDirectoryContent> file;

    private void refresh()

    {

        file.RefreshFilesAsync();

    }

}



Kindly check out the shared details and if you are still facing the issue feel free to get back to us for further assistance.


Regards,

Jafar


Attachment: BlazorAppFile_780fc9be.zip

Marked as answer
Loader.
Up arrow icon