Just want to understand why it is called for items outside the provided list count
var hierarchyList = currentSelectedTable.GetDropsInHierarchyWay(settings);
var dropsListView = rootVisualElement.Q<ListView>("table-information--drops");
dropsListView.makeItem = () => item.Instantiate();
dropsListView.itemsSource = hierarchyList;
dropsListView.bindItem = (item, i) =>
{
if (i >= hierarchyList.Count)
{
Debug.Log($"i {i} - Count {hierarchyList.Count}"); // This enter a bunch of times
return;
}
...
I just came here looking for the same answer, but it looks like I found it just minutes after. I think your ListView may have the property ‘showBoundCollectionSize’ set to true. This apparently means that it uses the size of the collection as the first item, thus making the collection 1 bigger. In any case, setting it to false solved it for me. Hopefully this helps you.
Thanks for getting the time to post it, this bound size property has indeed been set to true but unfortunately changing it didn’t solve the problem, I still receiving an out-of-range exception.