Hi all,
I’m trying to set up a ListViewwith multiple selections supported during runtime. Making items, binding and everything else including SelectionType.Singleis working as expected. Changing the selectionType on the listview to SelectionType.Multiple however has no effect. I still only get a single selection.
Using the debugger I can see that the item I clicked is getting the correct pseudo state checked but in-turn, it is removing it from the other items in the list.
Here’s the code for setting up my list view
_unitsListView = this.Q<ListView>("unit-listview");
if (_unitsListView != null)
{
_unitsListView.makeItem = () => unitItemElement.CloneTree();
_unitsListView.bindItem = BindItem;
_unitsListView.itemsSource = UnitEntities;
_unitsListView.itemsChosen += UnitsListViewOnItemsChosen;
_unitsListView.selectionType = SelectionType.Multiple;
}
And the UXML
<ui:ListView focusable="true" name="unit-listview" header-title="My Units" fixed-item-height="50" selection-type="Multiple" show-foldout-header="true" show-bound-collection-size="false" style="flex-grow: 1; flex-direction: column; width: auto;" />
Using Unity 2023.2.0 (beta) but I only upgraded to this to see if the problem persists - was previously on 2022.2.12f12 and had the same problem.
Is this a bug?
Thanks