I have an SfListView control that I am unable to select by scrolling up and down using the arrow keys. I have to move my mouse instead to select the item. Is there a setting that I am missing?
Hi Sree Sundaram,
We suggest to set the AllowKeyNavigation property to true to scroll using arrow keys with selection. Please refer the attached code snippet for your reference.
Code snippet:
<syncfusion:SfListView x:Name="listView" AllowKeyboardNavigation="True" SelectionGesture="Tap" ItemsSource="{Binding MusicInfo}" SelectionMode="Single" ItemSpacing="3" IsStickyHeader="True" ItemSize="70">
|
Please refer the below user guide for Selection using KeyNavigation in SfListView.
UG Link: https://help.syncfusion.com/xamarin/listview/selection#key-navigation
Please let us know if you need further assistance.
Regards,
Suthi Yuvaraj.
Hello, the above solution does not work. I am still unable to scroll through the ListView
Hi Sree Sundaram,
Also, please modify the sample to the reported scenario and share the below details, which would be helpful for us to check on it and provide you with the solution as soon as possible.
Regards,
Suthi Yuvaraj
<PackageReference Include="Syncfusion.Xamarin.DocIO" Version="19.4.0.53" />
<PackageReference Include="Syncfusion.Xamarin.Presentation" Version="19.4.0.53" />
<PackageReference Include="Syncfusion.Xamarin.SfChart" Version="19.4.0.53" />
<PackageReference Include="Syncfusion.Xamarin.SfListView" Version="19.4.0.53" />
<PackageReference Include="Syncfusion.Xamarin.SfPopupLayout" Version="19.4.0.53" />
Here is the code snippet:
<syncfusion:SfListView AllowKeyboardNavigation="True" x:Name="lstProjectValueMetrics" WidthRequest="200" HeightRequest="200">
<syncfusion:SfListView.RowDefinitions>
<RowDefinition Height="*"/>
</syncfusion:SfListView.RowDefinitions>
<syncfusion:SfListView.ItemTemplate>
<DataTemplate>
<ViewCell>
<StackLayout Orientation="Horizontal" HorizontalOptions="Start">
<StackLayout Padding="5" Orientation="Vertical" VerticalOptions="Start">
<Label Style="{StaticResource DefaultLabelSmallBoldStyle}" Text="{Binding DisplayName}"/>
<Label Style="{StaticResource DefaultLabelSmallStyle}" FontAttributes="Italic" Text="{Binding DisplayValue}"/>
<!-- <Label Style="{StaticResource DefaultLabelSmallStyle}" FontAttributes="Italic" Text="{Binding MetricValue, StringFormat='{0:0,0.00}'}"/> -->
</StackLayout>
</StackLayout>
</ViewCell>
</DataTemplate>
</syncfusion:SfListView.ItemTemplate>
</syncfusion:SfListView>
It does not work both on UWP as well as in Android
Hi Sree Sundram,
We regret let you know that we are unable to replicate the
reported scenario on our end with provided code snippet and nuget version. We
have prepared a simple sample with provided code snippet and attached here for
your reference. Please have a look at this sample and let us know if missed any
customization you have done in your application or revert us with modified sample or full XAML and C# code snippets related to
SfListView to replicate the reported issue on our end in UWP platform. Please
share details of device that you have tested and
Xamarin.Forms version It will be more helpful
for us to provide timely solution.
Regards,
Suthi Yuvaraj