Forum Xamarin.Android
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

How to Disable ListView?

Xammy10Xammy10 Member ✭✭✭

I'm working with an application that if you pick an item(once) on the list view, It will be highlight by color and the other items or the whole listview will be disabled. I already did the highlight part but the disabling part, I don't have any clue. I try "ListView.Enable(false);"
Thanks in advance :)


  • JGoldbergerJGoldberger USMember, Forum Administrator, Xamarin Team, University Xamurai


    You can just unsubscribe to the ListView's ItemClick event, eg:

    listView.ItemClick += MainList_ItemClick;
    void MainList_ItemClick(object sender, AdapterView.ItemClickEventArgs e)
            listView.ItemClick -= MainList_ItemClick;
            // run any other code you need to run on this item click. 

    listView.Enabled = false worked as well on my end but this also disabled the scrolling for the listView.

Sign In or Register to comment.