Hi,
I'm experiencing crash in my RadCartesianChart. I have a databound grid showing the source data, I also have a RadCartesianChart with a ScatterLineSeries showing a graphical representation of this data. The ScatterLineSeries I create and add to the chart in code.
When I delete rows from the grid, the points are also removed from the chart, as expected.
After I make certain changes, I wish to clear the chart and draw the series again, to do this I call RadCartesianChart.Series.Clear() and recreate the series once again. Once I've done this however, if I delete an entry in the grid I experience a crash with the error....
An unhandled exception of type 'System.ArgumentException' occurred in Telerik.Windows.Controls.Chart.dll
Additional information: The provided node does exist in this collection.
Am I clearing out the series correctly when I reset the chart?
I have produced a small test app to demonstrate this behaviour available on request.
Here is the stack trace.
at Telerik.Charting.NodeCollection.Remove(ChartNode node)
at Telerik.Charting.ElementCollection`1.RemoveItem(Int32 index)
at System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
at Telerik.Charting.DataPointCollection`1.System.Collections.Generic.IList<Telerik.Charting.DataPoint>.RemoveAt(Int32 index)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.PerformRemove(Object removedDataItem, Int32 removedItemIndex)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.HandleItemRemove(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
at System.Collections.ObjectModel.Collection`1.Remove(T item)
at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Remove(Object value)
at Telerik.Windows.Data.QueryableCollectionView.RemoveItemFromSourceList(IList list, Object removedItem)
at Telerik.Windows.Data.QueryableCollectionView.RemoveItemFromSource(Object removedItem)
at Telerik.Windows.Data.QueryableCollectionView.Remove(Object item)
at Telerik.Windows.Data.DataItemCollection.Remove(Object item)
at Telerik.Windows.Controls.GridView.GridViewDataControl.DeleteItems(IEnumerable`1 itemsToDelete)
at Telerik.Windows.Controls.GridView.GridViewDataControl.DeleteSelectedItems()
at Telerik.Windows.Controls.GridView.GridViewDataControl.TryDeleteSelectedItems()
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnDeleteCommand(Object sender, ExecutedRoutedEventArgs e)
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.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
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.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.Execute(Object parameter, IInputElement target)
at Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand()
at Telerik.Windows.Controls.GridView.GridViewDataControl.PendAndExecuteCommands(KeyEventArgs e)
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)
at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
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.RaiseTrustedEvent(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, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
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()
Thanks,
Rob
I'm experiencing crash in my RadCartesianChart. I have a databound grid showing the source data, I also have a RadCartesianChart with a ScatterLineSeries showing a graphical representation of this data. The ScatterLineSeries I create and add to the chart in code.
When I delete rows from the grid, the points are also removed from the chart, as expected.
After I make certain changes, I wish to clear the chart and draw the series again, to do this I call RadCartesianChart.Series.Clear() and recreate the series once again. Once I've done this however, if I delete an entry in the grid I experience a crash with the error....
An unhandled exception of type 'System.ArgumentException' occurred in Telerik.Windows.Controls.Chart.dll
Additional information: The provided node does exist in this collection.
Am I clearing out the series correctly when I reset the chart?
I have produced a small test app to demonstrate this behaviour available on request.
Here is the stack trace.
at Telerik.Charting.NodeCollection.Remove(ChartNode node)
at Telerik.Charting.ElementCollection`1.RemoveItem(Int32 index)
at System.Collections.ObjectModel.Collection`1.RemoveAt(Int32 index)
at Telerik.Charting.DataPointCollection`1.System.Collections.Generic.IList<Telerik.Charting.DataPoint>.RemoveAt(Int32 index)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.PerformRemove(Object removedDataItem, Int32 removedItemIndex)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.HandleItemRemove(NotifyCollectionChangedEventArgs e)
at Telerik.Windows.Controls.ChartView.ChartSeriesDataSource.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.Specialized.NotifyCollectionChangedEventHandler.Invoke(Object sender, NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
at System.Collections.ObjectModel.ObservableCollection`1.RemoveItem(Int32 index)
at System.Collections.ObjectModel.Collection`1.Remove(T item)
at System.Collections.ObjectModel.Collection`1.System.Collections.IList.Remove(Object value)
at Telerik.Windows.Data.QueryableCollectionView.RemoveItemFromSourceList(IList list, Object removedItem)
at Telerik.Windows.Data.QueryableCollectionView.RemoveItemFromSource(Object removedItem)
at Telerik.Windows.Data.QueryableCollectionView.Remove(Object item)
at Telerik.Windows.Data.DataItemCollection.Remove(Object item)
at Telerik.Windows.Controls.GridView.GridViewDataControl.DeleteItems(IEnumerable`1 itemsToDelete)
at Telerik.Windows.Controls.GridView.GridViewDataControl.DeleteSelectedItems()
at Telerik.Windows.Controls.GridView.GridViewDataControl.TryDeleteSelectedItems()
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnDeleteCommand(Object sender, ExecutedRoutedEventArgs e)
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.UIElement.OnExecutedThunk(Object sender, ExecutedRoutedEventArgs e)
at System.Windows.Input.ExecutedRoutedEventArgs.InvokeEventHandler(Delegate genericHandler, Object target)
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.RoutedCommand.ExecuteImpl(Object parameter, IInputElement target, Boolean userInitiated)
at System.Windows.Input.RoutedCommand.Execute(Object parameter, IInputElement target)
at Telerik.Windows.Controls.GridView.GridViewDataControl.ExecutePendingCommand()
at Telerik.Windows.Controls.GridView.GridViewDataControl.PendAndExecuteCommands(KeyEventArgs e)
at Telerik.Windows.Controls.GridView.GridViewDataControl.OnKeyDown(KeyEventArgs e)
at System.Windows.UIElement.OnKeyDownThunk(Object sender, KeyEventArgs e)
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.RaiseTrustedEvent(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, Int32 numArgs)
at MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler)
at System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs)
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()
Thanks,
Rob