System.InvalidOperationException: ItemsSource doesn't contains the provided item

if I want to clear selected item in the viewmodel and raise like below. it will throw this exception. why should this behave like that? how can you clear the selected item using mvvm binding?

SelectedItem = null;
RaisePropertyChanged("SelectedItem");

      <sfListView:SfListView x:Name="list"
                           ItemsSource="{Binding Items}"  SelectedItem="{Binding SelectedItem, Mode=TwoWay}"  

1 Reply

MK Muthu Kumaran Gnanavinayagam Syncfusion Team February 19, 2018 11:14 AM UTC

Hi Emil, 
 
Sorry for the inconvenience. 
 
We have checked the reported query “InvalidOperationException throws when cleared the SelectedItem and raised the property bound to SelectedItem property” from our side. We are glad to let you that the reported issue has been logged as defect at our end and the fix will be included in our upcoming 2018 Volume 1 main release. We will let you know once the release has been rolled out. 
 
Regards, 
G.Muthu kumaran. 


Loader.
Up arrow icon