Windows Dev Center

FileOpenPickerUI.FileRemoved | fileremoved event

Fires when the user removes a file from the list of files that the user has chosen if that file was added by the app that is providing files.


function onFileRemoved(eventArgs) { /* Your code */ }
// addEventListener syntax
fileOpenPickerUI.addEventListener("fileremoved", onFileRemoved);
fileOpenPickerUI.removeEventListener("fileremoved", onFileRemoved);
- or -

fileOpenPickerUI.onfileremoved = onFileRemoved;

Event information

Delegate TypedEventHandler<FileOpenPickerUI, FileRemovedEventArgs>


If your app participates in the File Open Picker contract and your app uses the app page that is hosted in the file picker to visually indicate which items the user selects, you should respond to this event. When a fileremoved event fires you should update your app's file picker page to reflect the change. Learn more about responding to this event in fileRemovedEventArgs.


The File picker sample demonstrates how to respond to a fileremoved event handler.

// Event handler
function onFileRemovedFromBasket(e) {
    // Perform tasks when an item is removed from the file picker, like updating buttons or notifying the user

    // Add any code to be called when an item is removed from the basket by the user
    WinJS.log && WinJS.log(SdkSample.fileRemoved, "sample", "status");

    // Adjust the add/remove buttons based on removal
    updateSelectionState(, false);

// Register for the event
fileOpenPickerUI.addEventListener("fileremoved", onFileRemovedFromBasket, false);

Both args and e (in C# and JS respectively) contain a FileRemovedEventArgs object.

For JavaScript, SdkSample.fileRemoved is an app variable that contains a string that used to used to notify the user.

For C#, id is an app variable that gets an identifier for the file and UpdateButtonState is one of the app's helper methods.

Requirements (Windows 10 device family)

Device family


API contract

Windows.Foundation.UniversalApiContract, introduced version 1.0


Windows::Storage::Pickers::Provider [C++]



Requirements (Windows 8.x and Windows Phone 8.x)

Minimum supported client

Windows 8

Minimum supported server

Windows Server 2012

Minimum supported phone

Windows Phone 8.1 [Windows Phone Silverlight 8.1 and Windows Runtime apps]


Windows::Storage::Pickers::Provider [C++]



See also

FileOpenPickerUI class
FileRemovedEventArgs class



© 2015 Microsoft