Add EnableItemSelection Property to ListView

DavidTavarezDavidTavarez DOMember ✭✭✭
edited December 2016 in Xamarin.Forms

Summary

Add a property to ListView to enable or disable item selection in a ListView.

API Changes

In order to facilitate the new Shiny Button api, a bool is added to the Button class. This is done as a bool because it is simpler to data bind and other reasons...

var list = new ListView ();
list.EnableItemSelection = false; // new API

Is EnableItemSelection equals true user can't tap on the item.

Intended Use Case

When you are displaying items and you need to allow actions through buttons.

You have something like this:

You don't want this effect:

Tagged:

Open · Last Updated

Posts

  • NMackayNMackay GBInsider, University mod

    The Telerik listview control supports this out of the box, I can see why this would be very useful as we've used that feature a few times.

  • TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai

    +1 from me, we need to do a review on how this would interact with IsEnabled to make sure we understand all the ramifications of this kind of change.

  • AdrianKnightAdrianKnight USMember ✭✭✭✭
    edited December 2016

    Can't you remove item selection highlight so that visually it's the same whether an item is selected or not? I suppose if you want this in Core, then I could see how this could be useful.

  • SelvamzSelvamz INMember ✭✭

    @DavidTavarez , You can use Syncfusion ListView. It has support to enable and disable the item selection by updating SelectionMode property.

    https://help.syncfusion.com/xamarin/sflistview/selection

    Note: Syncfusion controls is available for free through the community license program if you qualify (less than 1 million USD in revenue).

  • MichaelRumplerMichaelRumpler ATMember ✭✭✭✭✭

    Don't forget the TableView. It should be added there as well.

    In the settings of my app I show a TableView in my Master page to select one of several detail pages which are displayed side by side with the Master (MasterBehavior=Split). It would be handy to highlight the corresponding item in the TableView.

  • IsmaelMendoncaIsmaelMendonca USMember ✭✭

    Man, this feature would be very very useful.

    Please make it happen! ListView is one of the most used component in mobile apps and is the tougher one to customize, even Android and iOS doesn't have a pretty solution for that, as WindowsPhone former programmer, I can say that far way, the UWP solution is the best until now.

    If this feature come up the programmers life would be a lot of easier.

  • ehainesehaines Member ✭✭

    I'd really like to see this.

Sign In or Register to comment.