This question is locked. New answers and comments are not allowed.
I am using the latest release of Silverlight 3 (July 1, 2009) and am experiencing some strange behavior when trying to use the grouping in the gridview. Upon trying to group I sometimes (at least 50% of the time) will wind up with two groups for each item that was supposed to be grouped. For example, if I have a column in the grid like City there would be two groups formed for each city. When I try to expand one of the groups then I get the following error:
Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentException: Duplicate key detected!
Parameter name: key
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.AddKey(TKey key, Int32 index)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.InsertItem(Int32 index, TItem item)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.AddRange(RadKeyedCollection`2 collection)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateChildHeightsCache(PhysicalHeightsCacheCollection result, Int32 indexInGroup, GroupRecord parentGroup, Int32 grIndex)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateRecordsHeightsCache(IList`1 records, Int32 firstIndexInGroup, Boolean isCalledByParent)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.RefreshItemsPhysicalHeightsCache()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.UpdateRowHeight(IRowItem child)
at Telerik.Windows.Controls.GridView.GroupVirtualizingPanel.UpdateRowHeight(IRowItem child)
at Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
On the occasion that the groups are each only there once everything works as expected.
Any suggestions? I am binding to a very simple observable collection which is created at run time. In the silverlight 2 build of the same application the grouping works without any problems.
Thanks in advance for your help.
Microsoft JScript runtime error: Unhandled Error in Silverlight Application
Code: 4004
Category: ManagedRuntimeError
Message: System.ArgumentException: Duplicate key detected!
Parameter name: key
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.AddKey(TKey key, Int32 index)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.InsertItem(Int32 index, TItem item)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.RadKeyedCollection`2.AddRange(RadKeyedCollection`2 collection)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateChildHeightsCache(PhysicalHeightsCacheCollection result, Int32 indexInGroup, GroupRecord parentGroup, Int32 grIndex)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateRecordsHeightsCache(IList`1 records, Int32 firstIndexInGroup, Boolean isCalledByParent)
at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.RefreshItemsPhysicalHeightsCache()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent()
at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.UpdateRowHeight(IRowItem child)
at Telerik.Windows.Controls.GridView.GroupVirtualizingPanel.UpdateRowHeight(IRowItem child)
at Telerik.Windows.Controls.GridView.BaseVirtualizingPanel.MeasureOverride(Size availableSize)
at System.Windows.FrameworkElement.MeasureOverride(IntPtr nativeTarget, Single inWidth, Single inHeight, Single& outWidth, Single& outHeight)
On the occasion that the groups are each only there once everything works as expected.
Any suggestions? I am binding to a very simple observable collection which is created at run time. In the silverlight 2 build of the same application the grouping works without any problems.
Thanks in advance for your help.
