help using sflistview


i have this error.

La imagen puede contener: texto que dice

this is the xaml
SelectionMode="Multiple"
SelectionGesture="Tap"
SelectionBackgroundColor="Gold"
ItemsSource="{Binding BookInfo}"
SelectedItem="{Binding SelectedItem}">

and the viewmodel 
public ObservableCollection SelectedItem
{
get => _selectedItem;
set => SetProperty(ref _selectedItem, value);
}

1 Reply

LN Lakshmi Natarajan Syncfusion Team January 8, 2021 05:32 AM UTC

Hi Jose, 
 
Thank you for using Syncfusion products. 
 
We have checked the reported query “NullReference exception occurs in SfListView” from our side.  We have analyzed the provided code snippets and we would like to inform you that SelectedItem is used to programmatically select the ListViewItem when SelectionMode is Single. Could you please bind the observable collection to the SfListView.SelectedItems property and let us know the issue resolved or not? 
 
Please refer to our documentation regarding the same from the following link, 
 
Also, if issue reproduced in iOS platform kindly ensure the SfListViewRenderer is initialized in the AppDelegate class. Please refer to our documentation from the following link, 
 
If you still facing the same issue, please revert us back with the following details which would be helpful for us to check on it and provide you the solution as soon as possible, 
  • Share ListView XAML code snippets
  • Share issue replication procedure
  • Share the stack trace of the crash
  • Share issue reproducing platform and device configuration details
  • Share Syncfusion and Xamarin.Forms version
 
Lakshmi Natarajan 
 


Loader.
Up arrow icon