How to Disable ListView?

EnoharaEnohara 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 :)

Answers

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

    @Enohara

    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.