Skip to content

This repository contains the sample about how to animate items programmatically on selection in xamarin.forms listview

Notifications You must be signed in to change notification settings

SyncfusionExamples/Animate-items-programmatically-on-selection-in-xamarin.forms-listview

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 

Repository files navigation

Programmatic animation in ListView

When the SfListView.SelectionMode is other than None, the item or items in the SfListView can be selected from the code by setting the SfListView.SelectedItem, or adding items to the SfListView.SelectedItems property based on the SfListView.SelectionMode.

When the selection mode is Single, programmatically select an item by setting the underlying object to the SfListView.SelectedItem property.

//Perform selection using selected item
listView.SelectedItem = viewModel.Items[5];

When the selection mode is Multiple, programmatically select more than one item by adding the underlying object to the SfListView.SelectedItems property.

//Perform multiple selection using selected items
listView.SelectedItems.Add (viewModel.Items [4]);
listView.SelectedItems.Add (viewModel.Items[5]);

All items of the SfListView can be selected using the SelectAll method.

listView.SelectAll();

Note

When programmatically select an item then the selection related events will not be triggered. It triggers only on UI interactions. However, get the notification from the SelectedItems collection changed event which will be triggered when add an item at runtime.

To know more about the Selection in ListView, please refer our documentation here

About

This repository contains the sample about how to animate items programmatically on selection in xamarin.forms listview

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages