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

The Most Bizarre Grid Crash After Editing

6 Answers 106 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Paul Gallen
Top achievements
Rank 1
Paul Gallen asked on 13 Jan 2009, 04:36 PM
Hi,

I have sucessfully bounfd my collection the the grid.

After editing the contents in the Grid's Cell the application crashes, with a bizarre result: A File Dialog box pops open looking for :-
r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs.

What on earth!!!!


I cancel the box and and I get TargetInvocationException was unhandled exception

System.Reflection.TargetInvocationException was unhandled
  Message="Exception has been thrown by the target of an invocation."
  Source="mscorlib"
  StackTrace:
       at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
       at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
       at System.Delegate.DynamicInvokeImpl(Object[] args)
       at System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
       at Telerik.Windows.Controls.GridView.GridViewCell.RaiseEventEditEnded() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 1103
       at Telerik.Windows.Controls.GridView.GridViewCell.CommitEdit() in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 710
       at Telerik.Windows.Controls.GridView.GridViewCell.HandleCellKeyCommand(CellAction cellAction) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 911
       at Telerik.Windows.Controls.GridView.GridViewCell.GridViewCell_KeyUp(Object sender, KeyEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Cells\GridViewCell.cs:line 546
       at System.Windows.Input.KeyEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
       at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
       at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
       at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
       at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
       at System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted)
       at System.Windows.Input.InputManager.ProcessStagingArea()
       at System.Windows.Input.InputManager.ProcessInput(InputEventArgs input)
       at System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport)
       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, Boolean isSingleParameter)
       at System.Windows.Threading.ExceptionWrapper.TryCatchWhen(Object source, Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.WrappedInvoke(Delegate callback, Object args, Boolean isSingleParameter, Delegate catchHandler)
       at System.Windows.Threading.Dispatcher.InvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Boolean isSingleParameter)
       at System.Windows.Threading.Dispatcher.Invoke(DispatcherPriority priority, Delegate method, Object arg)
       at System.Windows.Interop.HwndSource.OnPreprocessMessageThunk(MSG& msg, Boolean& handled)
       at System.Windows.Interop.HwndSource.WeakEventPreprocessMessage.OnPreprocessMessage(MSG& msg, Boolean& handled)
       at System.Windows.Interop.ComponentDispatcherThread.RaiseThreadMessage(MSG& msg)
       at System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame)
       at System.Windows.Threading.Dispatcher.Run()
       at System.Windows.Application.RunDispatcher(Object ignore)
       at System.Windows.Application.RunInternal(Window window)
       at System.Windows.Application.Run(Window window)
       at System.Windows.Application.Run()
       at FTS.CMX.WPFApplication.Application.Main() in C:\Projects\CMX\FTS.CMX.WPFApplication\obj\Debug\Application.g.vb:line 75
       at System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)
       at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
       at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
       at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
       at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
       at System.Threading.ThreadHelper.ThreadStart()
  InnerException: System.Reflection.TargetInvocationException
       Message="Exception has been thrown by the target of an invocation."
       Source="mscorlib"
       StackTrace:
            at System.RuntimeMethodHandle._InvokeMethodFast(Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
            at System.RuntimeMethodHandle.InvokeMethodFast(Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeTypeHandle typeOwner)
            at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
            at System.Delegate.DynamicInvokeImpl(Object[] args)
            at System.Windows.RoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget)
            at System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target)
            at System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs)
            at System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised)
            at System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args)
            at System.Windows.UIElement.RaiseEvent(RoutedEventArgs e)
            at Telerik.Windows.Controls.GridView.GridViewRow.HandleValueChangedAfterEdit(RadRoutedEventArgs editEventArgs, RecordsChangeListener changeListener) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Rows\GridViewRow.cs:line 534
            at Telerik.Windows.Controls.GridView.GridViewRow.Cell_EditCommitted(Object sender, CellRoutedEventArgs e) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\Rows\GridViewRow.cs:line 554
       InnerException: System.ArgumentNullException
            Message="Value cannot be null.\r\nParameter name: fieldName"
            Source="Telerik.Windows.Controls.GridView"
            ParamName="fieldName"
            StackTrace:
                 at Telerik.Windows.Controls.GridView.GridViewDataControl.DataError(Object sender, DataErrorEventArgs args) in r:\WPF_Scrum\WPF_Team\Sources\Development\WPF\GridView\GridView\GridViewDataControl.cs:line 929
            InnerException:



P

6 Answers, 1 is accepted

Sort by
0
Hristo Deshev
Telerik team
answered on 15 Jan 2009, 01:36 PM
Hello Paul Gallen,

You must be getting the R:\... path because we ship the pdb files with the assemblies. I am more worried about the exception though. I must admit I have never seen such a stack trace. Can you help me reproduce it? Posting some code would be great. Thanks!

Sincerely yours,
Hristo Deshev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul Gallen
Top achievements
Rank 1
answered on 16 Jan 2009, 04:54 PM
HI I was evaluating your WPF grid, not I did not save the source, but it does evolve around ADO entity. I found the same problem with your win forms grid pre SP1.

OK here are the steps to reproduce some of the problem(s) - (not exact code) 

Create an ADO Model from northwinds
Get a reference to a customer object  i.e Customer = (From c in cx.Customers.Incude("Orders")).First
Bind the orders to the grid from the customer  i.e Grid.ItemsSource = Customer.Orders.ToList

Add a new Order for the customer .ie. Dim Order as new Model.Order
                                                            Order.ShipCity="London"
                                                             Customer.Orders.Add(Order)

At this point your grid does not reflect any changes through the binding, Now, I know the Orders collection are not an IBindingList however, other vendors WPF grids do show the new order. 

 - (lost code)  - park your grid in edit mode on the newly added bound object

Edit the new object in your grid  - press return - and I get the formentioned error stack trace.


P
0
Jordan
Telerik team
answered on 20 Jan 2009, 04:50 PM
Hi Paul,

Unfortunately, this is a bug in the RadGridView - the collection is not wrapped appropriately. This issue will be fixed with our Q1 release.
Meanwhile, I can suggest you the following workaround:
customer = (from c in context.Customers.Include("Orders") select c).First();  
GridView1.ItemsSource = ((IListSource)customer.Orders).GetList(); 

As for the exception, I've tried to reproduce it but to no avail. I've attached my test project.
Please, modify it so that the problem is reproduced and send it back to me.

Greetings,
Jordan
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Paul Gallen
Top achievements
Rank 1
answered on 21 Jan 2009, 02:37 PM
Thanks Jordan

If I ever get the same stack trace again, I will pick up this thread and post it here again

P
0
Iurii
Top achievements
Rank 1
answered on 11 Mar 2009, 11:22 PM
I've just encountered the same problem. When is the Q1 coming out?
0
Vlad
Telerik team
answered on 12 Mar 2009, 04:34 PM
Hi Iurii,

The release will be today.

Greetings,
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.
Tags
GridView
Asked by
Paul Gallen
Top achievements
Rank 1
Answers by
Hristo Deshev
Telerik team
Paul Gallen
Top achievements
Rank 1
Jordan
Telerik team
Iurii
Top achievements
Rank 1
Vlad
Telerik team
Share this question
or