I have a custom listview
with checkBoxes and populates it with data from List<>
. I was thinking how to receive the items which are checked and I basically couldn't find the solution. Is it possible to make it with the ListView
like this or should I make a custom ListView
? Any ideas? Thanks in advance.
Here is the code I am trying to deal with:
public string content;
ListView productsListView;
List<Product> _productsList = ProductsFromXml();
//list for checked items (not yet)
List<Product> checkedProducts = new List<Product>();
//creating a ListView within our products
productsListView = FindViewById<ListView>(Resource.Id.listView1);
productsListView.Adapter = new ArrayAdapter(this, Android.Resource.Layout.SimpleListItemMultipleChoice, _productsList);
productsListView.ChoiceMode = ChoiceMode.Multiple;