Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

ListView Xaml: IsGroupingEnabled and ItemsSource cause System.ArgumentException

$
0
0

When I was working on ListView, I kept get System.ArgumentException "An item with the same key has already been added."

So I did some experiments.

The problematic code:

<ListView  x:Name="TVListingListView"
                ItemsSource="CollectionGrouped"
                IsGroupingEnabled="True"
                GroupDisplayBinding="{Binding GroupKey}"
                GroupShortNameBinding="{Binding GroupKey}">

I can get rid of the exception by removing either "IsGroupingEnabled" or "ItemsSource". In another word, if only one of them presents, there is no problem. But if both present, an exception will be thrown.

I'm assuming it is a bug on Xamarin.Forms?

BTW, I'm using Xamarin.Forms 1.4.4.6392.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>