Welcome to the UWP feedback portal. We’re happy you’re here! If you have feedback on how to improve the UWP, we’d love to hear it!>
Thanks for joining our community and helping improve Syncfusion products!
I created a class structure like this:
class ParentClass
{
public Context Context {get; set;}
}
class ChildClass : ParentClass
{
public new ClientContext Context {get; set;}
}
And then set my itemssource to a List<ChildClass>(). When I set the itemssource it throws this exception:
System.ArgumentException: 'An item with the same key has already been added. Key: Context'
The stack trace implies that it's harvesting all the properties and adding them to a collection and this is causing an issue because it finds both "Context" properties and tries to add each as a key:
at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at Syncfusion.Data.PropertyInfoCollection.<.ctor>b__3_0(PropertyInfo p)
at Syncfusion.Data.Extensions.FunctionalExtensions.ForEach[T](IEnumerable`1 items, Action`1 action)
at Syncfusion.Data.PropertyInfoCollection..ctor(Type type)
at Syncfusion.Data.CollectionViewAdv.SetItemProperties(IEnumerable dataSource)
at Syncfusion.Data.CollectionViewAdv.InitiateCollectionViewAdv()
at Syncfusion.Data.CollectionViewAdv..ctor(IEnumerable _source, Type sourceType)
at Syncfusion.UI.Xaml.Grid.GridQueryableCollectionViewWrapper..ctor(IEnumerable source, SfDataGrid grid)
at Syncfusion.UI.Xaml.Grid.SfDataGrid.CreateCollectionViewAdv(IEnumerable source, SfDataGrid dataGrid)
at Syncfusion.UI.Xaml.Grid.SfDataGrid.CreateCollectionView(Object itemsSource)
at Syncfusion.UI.Xaml.Grid.SfDataGrid.SetSourceList(Object itemsSource)
at Syncfusion.UI.Xaml.Grid.SfDataGrid.OnItemsSourceChanged(DependencyObject obj, DependencyPropertyChangedEventArgs args)
at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at Syncfusion.UI.Xaml.Grid.GridPropertyMetadata.OnInternalDependencyPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
at Windows.UI.Xaml.DependencyObject.SetValue(DependencyProperty dp, Object value)
at Syncfusion.UI.Xaml.Grid.SfDataGrid.set_ItemsSource(Object value)
at General.Common.DataGrid.DataGridControl.SetItemsSource()