0

I have a problem with my FileOpenPicker-app. If I select an item in my GridView, the item will be added to the FileOpenPickerUI, it works fine. But if I deselect an Item in the FileOpenPickerUI, it won´t deselect in my GridView.

So I added the Event:

_fileOpenPickerUI.FileRemoved += FilePickerUI_FileRemoved;

This is the method:

private async void FilePickerUI_FileRemoved(FileOpenPickerUI sender, FileRemovedEventArgs args)
{
   //DO SOMETHIG
}

This is the documentation: http://msdn.microsoft.com/de-de/library/windows/apps/windows.storage.pickers.provider.fileopenpickerui.fileremoved

How can I react to the deselected item? How can I deselect it in my GridView?

Soner Gönül
  • 97,193
  • 102
  • 206
  • 364
Invisibly
  • 71
  • 7

1 Answers1

0

There is no two way binding between the FileOpenPickerUI item selection/deselection and GridView item selection/deselection. If you can access the GridView's selected item within the FilePickerUI_FileRemovedhandler, you can explicitly set the SelectedIndexproperty to -1.

prthrokz
  • 1,120
  • 8
  • 16
  • The GridView can contains multiple items und you can select and deselect multiple items. I think to set the SelectedIndex to -1, if you just deselect one item, will not have the desired effect. – Invisibly Jan 07 '13 at 10:07
  • 1
    I suppose you then have some kind of relationship between the FileOpenPickerUI and GridView items explicitly defined. For each item you deselect in FileOpenPickerUI, get the corresponding GridView item and remove it from the SelectedItems collection. – prthrokz Jan 07 '13 at 10:15