Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to get all checked items from the Listview?

$
0
0

I need a way to get all checked items position in listview?I need this for deleting the notes. As of now i am doing like this

            if (noteCheckBox != null) {
                        noteCheckBox.Click += (sender, e) => {
                            if(noteCheckBox.Checked)
                            {
                                listViewItem.SetBackgroundColor(Color.Yellow);
                                noteIds.Add(this._notes[position].NoteId.ToString());
                            }
                            else
                            {
                                listViewItem.SetBackgroundColor(Color.Transparent);
                            }
                            string[] noteIdArray = noteIds.ToArray();
                            var noteIdList = new Intent();
                            noteIdList.PutExtra("DeleteNotes", noteIdArray);

                        };
                    }

And to get id's:

    if (this._deleteButton != null) {
                    this._deleteButton.Click += (sender, e) => 
                    {
                        var test = new Intent();
                        Array myList = (Array) test.GetSerializableExtra("DeleteNotes");
                        if(myList != null)
                        {
                            foreach(string s in myList)
                            {
                                Guid id = new Guid(s);
                                Delete(id);
                            }
                        }
                    };
                }

But myList is null. How to fix it?


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>