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

Gridview exception when pasting to sorted column

3 Answers 26 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Sylvain
Top achievements
Rank 1
Sylvain asked on 27 Feb 2013, 01:22 PM
Hi all,

Our WPF application use many GridViews and most of them allows column sorting. Problem: we often get a crash and this error message when pasting data in a sorted column: "Cell is already in the collection".

I know that you have answered similar problems before (see http://www.telerik.com/community/forums/silverlight/gridview/gridview-exception-on-pasting-from-excel.aspx), but none would help me.

We are currently using GridView.dll version 2012.2.725.40. The language is C# and the IDE is VStudio 2010 on Windows 7 Enterprise 64 bits. The WPF application uses MVVM Light.

Thank you in advance!!

-------------------------------------------------------

- Date: 27/02/2013 14:19:35
- Build: 1.0.0
- Outermost exception: Cell is already in the collection
Parameter name: cellInfo

- No innner exceptions

- Call stack:
   at Telerik.Windows.Controls.GridView.Selection.CellInfoCollection.Add(GridViewCellInfo cellInfo) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\Selection\CellInfoCollection.cs:line 130
   at Telerik.Windows.Data.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Core\Data\Extensions\CollectionExtensions.cs:line 22
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformPaste(String text) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Clipboard\GridViewDataControl.Clipboard.cs:line 322
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PasteFromClipboard() in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\Clipboard\GridViewDataControl.Clipboard.cs:line 290
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PasteExecuted(Object sender, ExecutedRoutedEventArgs e) in c:\TB\102\WPF_Scrum\Release_WPF\Sources\Development\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 2674
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(CommandBindingCollection commandBindings, Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Interop.HwndSource.OnPreprocessMessage(Object param)
   at System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs)
   at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)

3 Answers, 1 is accepted

Sort by
0
Vera
Telerik team
answered on 28 Feb 2013, 08:26 AM
Hi Sylvain,

 
The forum thread you mentioned is quite old and the issue was fixed right after it was reported. We are not able to reproduce it neither with the version you use, nor with our latest official - Q1 2013. Unfortunately, the only thing I could suggest you is to download Q1 2013 and to give it a try.

Kind regards,
Vera
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Boris Kudryashov
Top achievements
Rank 1
answered on 11 Feb 2014, 04:35 PM
We still have this issue with 2013.1.422.45
   at Telerik.Windows.Controls.GridView.Selection.CellInfoCollection.Add(GridViewCellInfo cellInfo) in c:\TB\221\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\Selection\CellInfoCollection.cs:line 147
   at Telerik.Windows.Data.CollectionExtensions.AddRange[T](ICollection`1 collection, IEnumerable`1 items) in c:\TB\221\WPF_Scrum\Current_HotFix\Sources\Core\Data\Extensions\CollectionExtensions.cs:line 22
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PerformPaste(String text) in c:\TB\221\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Clipboard\GridViewDataControl.Clipboard.cs:line 339
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PasteFromClipboard() in c:\TB\221\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\Clipboard\GridViewDataControl.Clipboard.cs:line 306
   at Telerik.Windows.Controls.GridView.GridViewDataControl.PasteExecuted(Object sender, ExecutedRoutedEventArgs e) in c:\TB\221\WPF_Scrum\Current_HotFix\Sources\Controls\GridView\GridView\GridView\GridViewDataControl.cs:line 2721
   at System.Windows.Input.CommandBinding.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.Input.CommandManager.ExecuteCommandBinding(Object sender, ExecutedRoutedEventArgs e, CommandBinding commandBinding)
   at System.Windows.Input.CommandManager.FindCommandBinding(Object sender, RoutedEventArgs e, ICommand command, Boolean execute)
   at System.Windows.Input.CommandManager.OnExecuted(Object sender, ExecutedRoutedEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
   at System.Windows.Input.CommandManager.TranslateInput(IInputElement targetElement, InputEventArgs inputEventArgs)
   at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
   at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
   at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
   at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
   at System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args)
   at System.Windows.Input.InputManager.ProcessStagingArea()
   at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
   at System.Windows.Interop.HwndKeyboardInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawKeyboardActions actions, Int32 scanCode, Boolean isExtendedKey, Boolean isSystemKey, Int32 virtualKey)
   at System.Windows.Interop.HwndKeyboardInputProvider.ProcessKeyAction(MSG& msg, Boolean& handled)
   at System.Windows.Interop.HwndSource.CriticalTranslateAccelerator(MSG& msg, ModifierKeys modifiers)
   at System.Windows.Forms.Integration.ElementHost.ProcessCmdKey(Message& msg, Keys keyData)
   at System.Windows.Forms.Control.PreProcessMessage(Message& msg)
   at System.Windows.Forms.Control.PreProcessControlMessageInternal(Control target, Message& msg)
   at System.Windows.Forms.Integration.ApplicationInterop.ThreadMessageFilter(MSG& msg, Boolean& outHandled)
   at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.TranslateAndDispatchMessage(MSG& msg)
   at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
   at System.Windows.Application.RunInternal(Window window)
   at System.Windows.Application.Run()
   at AvocetVM.App.Main() in c:\AvocetMain\Release\2013.1-Dev\AvocetVM\obj\Debug\App.g.cs:line 0
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()
0
Vera
Telerik team
answered on 12 Feb 2014, 08:56 AM
Hi Boris,

Will it be possible to open a support ticket and to send a simple runnable project demonstrating the problem? We will be glad to help once we are able to reproduce the exception on our side.

Regards,
Vera
Telerik

Check out the new Telerik Platform - the only modular platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native apps. Register for the free online keynote and webinar to learn more about the Platform on Wednesday, February 12, 2014 at 11:00 a.m. ET (8:00 a.m. PT).

Tags
GridView
Asked by
Sylvain
Top achievements
Rank 1
Answers by
Vera
Telerik team
Boris Kudryashov
Top achievements
Rank 1
Share this question
or