I used Drag & drop framework with XamOrgChart and works fine, but I get an exception if I change ItemsSource of XamOrgChart a second time.
I changed ItemsSource in response of a click on a button, that opens a dialog, do some changes on database, and then reload data and set ItemsSource to reflect changes.
I get a System.NullReferenceException:
en Infragistics.DragDrop.DragDropManager.GetElementWithMouseCapture() en Infragistics.DragDrop.DragDropManager.OnMouseLeftButtonDown(Object sender, MouseButtonEventArgs e) en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) en System.Windows.UIElement.OnMouseDownThunk(Object sender, MouseButtonEventArgs e) en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) en System.Windows.Input.InputManager.ProcessStagingArea() en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) en System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) en System.Windows.Window.ShowHelper(Object booleanBox) en System.Windows.Window.Show() en System.Windows.Window.ShowDialog() en GrupoSTRL.MainWindow.cEncargoNuevo_Click(Object sender, RoutedEventArgs e) en d:\Proyectos\GrupoSTRL\Src\GrupoSTRL\MainWindow.xaml.cs:línea 101 en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) en System.Windows.UIElement.RaiseEvent(RoutedEventArgs e) en System.Windows.Controls.Primitives.ButtonBase.OnClick() en Infragistics.Windows.Ribbon.ButtonTool.OnClick() en System.Windows.Controls.Primitives.ButtonBase.OnMouseLeftButtonUp(MouseButtonEventArgs e) en System.Windows.UIElement.OnMouseLeftButtonUpThunk(Object sender, MouseButtonEventArgs e) en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) en System.Windows.UIElement.ReRaiseEventAs(DependencyObject sender, RoutedEventArgs args, RoutedEvent newEvent) en System.Windows.UIElement.OnMouseUpThunk(Object sender, MouseButtonEventArgs e) en System.Windows.Input.MouseButtonEventArgs.InvokeEventHandler(Delegate genericHandler, Object genericTarget) en System.Windows.RoutedEventArgs.InvokeHandler(Delegate handler, Object target) en System.Windows.RoutedEventHandlerInfo.InvokeHandler(Object target, RoutedEventArgs routedEventArgs) en System.Windows.EventRoute.InvokeHandlersImpl(Object source, RoutedEventArgs args, Boolean reRaised) en System.Windows.UIElement.RaiseEventImpl(DependencyObject sender, RoutedEventArgs args) en System.Windows.UIElement.RaiseTrustedEvent(RoutedEventArgs args) en System.Windows.UIElement.RaiseEvent(RoutedEventArgs args, Boolean trusted) en System.Windows.Input.InputManager.ProcessStagingArea() en System.Windows.Input.InputManager.ProcessInput(InputEventArgs input) en System.Windows.Input.InputProviderSite.ReportInput(InputReport inputReport) en System.Windows.Interop.HwndMouseInputProvider.ReportInput(IntPtr hwnd, InputMode mode, Int32 timestamp, RawMouseActions actions, Int32 x, Int32 y, Int32 wheel) en System.Windows.Interop.HwndMouseInputProvider.FilterMessage(IntPtr hwnd, WindowMessage msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en System.Windows.Interop.HwndSource.InputFilterMessage(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en MS.Win32.HwndWrapper.WndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam, Boolean& handled) en MS.Win32.HwndSubclass.DispatcherCallbackOperation(Object o) en System.Windows.Threading.ExceptionWrapper.InternalRealCall(Delegate callback, Object args, Int32 numArgs) en MS.Internal.Threading.ExceptionFilterHelper.TryCatchWhen(Object source, Delegate method, Object args, Int32 numArgs, Delegate catchHandler) en System.Windows.Threading.Dispatcher.LegacyInvokeImpl(DispatcherPriority priority, TimeSpan timeout, Delegate method, Object args, Int32 numArgs) en MS.Win32.HwndSubclass.SubclassWndProc(IntPtr hwnd, Int32 msg, IntPtr wParam, IntPtr lParam) en MS.Win32.UnsafeNativeMethods.DispatchMessage(MSG& msg) en System.Windows.Threading.Dispatcher.PushFrameImpl(DispatcherFrame frame) en System.Windows.Threading.Dispatcher.PushFrame(DispatcherFrame frame) en System.Windows.Threading.Dispatcher.Run() en System.Windows.Application.RunDispatcher(Object ignore) en System.Windows.Application.RunInternal(Window window) en System.Windows.Application.Run(Window window) en System.Windows.Application.Run() en GrupoSTRL.App.Main() en d:\Proyectos\GrupoSTRL\Src\GrupoSTRL\obj\Debug\App.g.cs:línea 0 en System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args) en System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args) en Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() en System.Threading.ThreadHelper.ThreadStart_Context(Object state) en System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx) en System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state) en System.Threading.ThreadHelper.ThreadStart()
Hello,
What's the version this happens with? Could you prvide us with a sample wehere this exception can be reproduced?
Thanks.Plamen.
I'm using Infragistics NetAdvantage for WPF version 2012.1 with Visual Studio 2012RC.
I did a test project, the exception refreshing items source only raises when I update items source inside the NodeMouseDoubleClick event. Updating the data outside this event, from a button for example, works fine.
Do this to test the app:
1. In test app there's a button that update the data of the chart when you click it. Works fine.
2. Double click a node. Inside NodeMouseDoubleClick executes the same function as the button, but here raises an exception!!!
Note:
I found that using BeginInvoke solves the issue, that is, replacing
void chart_NodeMouseDoubleClick(object sender, OrgChartNodeClickEventArgs e)
{
this.FillChart();
}
by
this.Dispatcher.BeginInvoke(new Action(this.FillChart), null);
It seems some kind of bug?
Thanks for your help.