I think the MWC example approach is probably suitable (as someone already
pointed out), since using the built-in Android multi-select behavior for
ListView is really all about the 'click' performing the 'selection' and not
really having dual functions.

Having said that, I think you can force the ListView to do most of what you
want (whether it is a good UI choice is another matter). Some things to try:

* To turn multiple selection mode on:
myListView.ChoiceMode = 2 // Multiple (or
Android.Widget.ChoiceMode.Mulitple enum for API11+)

* To show the multiselect checkbox, use this as your cell layout (in your
Adapter)
Android.Resource.Layout.SimpleListItemMultipleChoice

* To pre-select mulitple items when you create the list, call this as many
times as required
myListView.SetItemChecked (1, true); // pass position in

* OnListItemClick still gets called (if you are using a ListActivity), in
it you can access CheckedItemPositions:
var sparseArray =
FindViewById<ListView>(Android.Resource.Id.List).CheckedItemPositions;
for (var i = 0; i < sparseArray.Size(); i++)
   Console.Write(sparseArray.KeyAt(i) + "=" + sparseArray.ValueAt(i) + ",");
Console.WriteLine();
---- note that the sparseArray contains an element for each item that had
its value changed - only the ones where ValueAt(i)==true are _currently_
selected


HTH?

cd


On Wed, Apr 4, 2012 at 3:30 AM, mlwright <michael.wri...@state.or.us> wrote:

> anybody have any ideas on how to do this in mono
>
> --
> View this message in context:
> http://mono-for-android.1047100.n5.nabble.com/using-a-checkbox-in-a-listview-tp5598987p5615899.html
> Sent from the Mono for Android mailing list archive at Nabble.com.
> _______________________________________________
> Monodroid mailing list
> Monodroid@lists.ximian.com
>
> UNSUBSCRIBE INFORMATION:
> http://lists.ximian.com/mailman/listinfo/monodroid
>
>
_______________________________________________
Monodroid mailing list
Monodroid@lists.ximian.com

UNSUBSCRIBE INFORMATION:
http://lists.ximian.com/mailman/listinfo/monodroid

Reply via email to