This is a migrated thread and some comments may be shown as answers.

[Solved] Q2-SL2-Duplicate Key Detected

2 Answers 137 Views
GridView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Barry Hester
Top achievements
Rank 2
Barry Hester asked on 30 Jul 2009, 05:23 PM
<tGrid:RadGridView x:Name="gResults" Grid.Row="1" AutoGenerateColumns="False" IsReadOnly="True" MultipleSelect="True"
            <tGrid:RadGridView.RowStyle> 
                <Style TargetType="tGridElements:GridViewRow"
                     
                    <Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" 
                            Value="True" /> 
                     
                </Style> 
            </tGrid:RadGridView.RowStyle> 
            <tGrid:RadGridView.AlternateRowStyle> 
                <Style TargetType="tGridElements:GridViewRow"
                     
                    <Setter Property="dragDrop:RadDragAndDropManager.AllowDrag" 
                            Value="True" /> 
                     
                </Style> 
            </tGrid:RadGridView.AlternateRowStyle> 
        <columns, etc/> 
</tGrid:RadGridView> 
Hello,

I know that someone else was having issues with Q2 SL3 and the "duplicate key detected" error.  However, I am using Q2 SL2.  The error is thrown when the grid is bound.  However it does not happen all the time.  Only certain result sets cause the error.  I am unable to determine what makes the "offending" result sets different.  The application stops working when this happens.  Is this a known issue?  If so, are there any plans to fix it?  This is critical for my application, so any interim workarounds or suggestions would be most helpful as well.  

I have included the gridview setup as well as the error...

Thanks!
Webpage error details 
 
User Agent: Mozilla/4.0 (compatible; MSIE 8.0; Windows NT 6.1; Trident/4.0; SLCC2; .NET CLR 2.0.50727; .NET CLR 3.5.30729; .NET CLR 3.0.30729; Media Center PC 6.0; InfoPath.2) 
Timestamp: Thu, 30 Jul 2009 17:16:00 UTC 
 
 
Message: Sys.InvalidOperationException: ManagedRuntimeError error #4004 in control 'Xaml1': 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 System.Collections.ObjectModel.Collection`1.Add(T item) 
   at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.CreateDataRecordsHeightsCache(IList`1 records, Double rowHeight, Int32 firstIndexInGroup, Int32 grIndex) 
   at Telerik.Windows.Controls.GridView.GridView.Scrolling.PhysicalHeightsCache.RefreshItemsPhysicalHeightsCache() 
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.OnRefreshScrollExtent() 
   at Telerik.Windows.Controls.GridView.GridViewVirtualizingPanel.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) 
Line: 453 
Char: 17 
Code: 0 
URI: http://localhost/ScriptResource.axd?d=-FbhHIhQXWtMvuYF0Uz-T0sNy2WEGlN3Ie9X35Ndw6lwkuW9qHf6DcRwQwnNiaOKmE-OszYxBdQkGtbYkLjPdA2&t=ffffffffafbd6209 
 

2 Answers, 1 is accepted

Sort by
0
Accepted
Vlad
Telerik team
answered on 31 Jul 2009, 05:10 AM
Hi Barry,

The issue is already fixed and the fix will be part of our service pack (next week).

Regards,
Vlad
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
Barry Hester
Top achievements
Rank 2
answered on 31 Jul 2009, 12:19 PM
I look forward to getting the bits.
Thank you very much!
Tags
GridView
Asked by
Barry Hester
Top achievements
Rank 2
Answers by
Vlad
Telerik team
Barry Hester
Top achievements
Rank 2
Share this question
or