Breaking Change T1080875
Visible to All Users

Upload - The component’s events change signature

What Changed

In previous versions, all Upload component events used JSInterop and had the Action<…> type.

In v22.1, the events have the EventCallback<…> type. We also removed the oldFileInfo and newFileInfo arguments of the FileReloaded event. Use the FileReloadedEventArgs class instead.

Reasons for Change

We removed JSInterop from implementation. The Upload component uses custom events to communicate with the server. This change allows you to use the component’s events asynchronously and prevent the UI from being blocked when events fire.

Impact on Existing Apps

This change affects your application if it uses DxUpload events.

How to Update Existing Apps

If you want to use a synchronous event handler, no changes are required. If you want to use an asynchronous event handler, change the event handler signature to an asynchronous one:

Razor
// Synchronous SelectedFileChanged event handler protected void SelectedFilesChanged{ //… } // Asynchronous SelectedFileChanged event handler protected async Task SelectedFilesChanged{ //… }

If you handle the FileReloaded event, replace the event arguments with FileReloadedEventArgs:

Razor
void OnFileReloaded(FileReloadedEventArgs args) { // ... }

Disclaimer: The information provided on DevExpress.com and affiliated web properties (including the DevExpress Support Center) is provided "as is" without warranty of any kind. Developer Express Inc disclaims all warranties, either express or implied, including the warranties of merchantability and fitness for a particular purpose. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.

Confidential Information: Developer Express Inc does not wish to receive, will not act to procure, nor will it solicit, confidential or proprietary materials and information from you through the DevExpress Support Center or its web properties. Any and all materials or information divulged during chats, email communications, online discussions, Support Center tickets, or made available to Developer Express Inc in any manner will be deemed NOT to be confidential by Developer Express Inc. Please refer to the DevExpress.com Website Terms of Use for more information in this regard.