Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/TBertuzzi/Xamarin.Forms.MultiSelectListView
:ballot_box_with_check: Select multiple rows in a listview with xamarin.forms
https://github.com/TBertuzzi/Xamarin.Forms.MultiSelectListView
android control ios nuget nuget-package xamarin xamarin-forms xamarin-library xamarin-plugin xamarinforms
Last synced: 29 days ago
JSON representation
:ballot_box_with_check: Select multiple rows in a listview with xamarin.forms
- Host: GitHub
- URL: https://github.com/TBertuzzi/Xamarin.Forms.MultiSelectListView
- Owner: TBertuzzi
- Created: 2018-03-07T16:53:10.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2021-10-05T16:53:58.000Z (about 3 years ago)
- Last Synced: 2024-11-07T10:02:53.867Z (about 1 month ago)
- Topics: android, control, ios, nuget, nuget-package, xamarin, xamarin-forms, xamarin-library, xamarin-plugin, xamarinforms
- Language: C#
- Homepage:
- Size: 333 KB
- Stars: 60
- Watchers: 6
- Forks: 10
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-xamarin-forms - Xamarin.Forms.MultiSelectListView ★59
README
# Xamarin.Forms.MultiSelectListView
Select multiple rows in a listview with xamarin.forms.
By default the listview control lets you only select one row at a time. The MultiSelectListView control uses a modified ObservableCollection to mark which rows have been selected.
You can use any image to mark the selected row.
###### This is the component, works on iOS and Android.
![](https://raw.githubusercontent.com/TBertuzzi/Xamarin.Forms.MultiSelectListView/master/Resources/select.png)
**NuGet**|Name|Info|
| ------------------- | :------------------: |
|MultiSelectListView|[![NuGet](https://buildstats.info/nuget/Xamarin.Forms.MultiSelectListView)](https://www.nuget.org/packages/Xamarin.Forms.MultiSelectListView/)|
|Build status|[![Build status](https://ci.appveyor.com/api/projects/status/github/TBertuzzi/xamarin-forms-multiselectlistview?branch=master&svg=true)](https://ci.appveyor.com/project/ThiagoBertuzzi/xamarin-forms-multiselectlistview)|**Build History**
[![Build history](https://buildstats.info/appveyor/chart/ThiagoBertuzzi/xamarin-forms-multiselectlistview?buildCount=33)](https://ci.appveyor.com/project/ThiagoBertuzzi/xamarin-forms-multiselectlistview/history)
**Platform Support**
MultiSelectListView is a .NET Standard 2.0 library.Its only dependency is the Xamarin.Forms
## Setup / Usage
Basically the key is to use the MultiSelectObservableCollection instead of the conventional ObservableCollection.
```csharp
public MultiSelectObservableCollection Users { get; }
```
The "IsSelected" property notifies when an object has been selected.
in the Xaml file we must declare our control xmlns: lv = "clr-namespace: Xamarin.Forms.MultiSelectListView; assembly = Xamarin.Forms.MultiSelectListView", for example .
Then use the new MultiSelect.Enable property to enable the multiple selection in the listview.
we must use the SelectableCell that contains the property to inform the icon of the selection
```csharp
```
## SelectedItemBehavior
SelectedItemBehavior to execute the command when the SelectedItem event occurs in ListView. Pass the item selected in ListView to Command.
Based on SelectedItemBehavior by [Atsushi Nakamura](https://github.com/nuitsjp) (https://github.com/nuitsjp/Xamarin.Forms.BehaviorsPack).
If ClearSelected property is true, SelectedItem property of ListView is cleared after command execution. Default ClearSelected property value is true.
You can use the object of the selected line
```csharp
```
Or specify the property you want to pass as a parameter
```csharp
```
The complete example can be downloaded here: https://github.com/TBertuzzi/Xamarin.Forms.MultiSelectListView/tree/master/MultiSelectListViewSample