When editing values in an detail grid and reloading the datasource after the new property value has been assigned by handling the ListChanged-Event of the datasource, a NullReferenceException occurs. It happens both when tabbing out of the column and when focusing another column by mouse click.
Moving focus with mouse click:
" bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.get_DownPointHitInfo()\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnMouseDown(MouseEventArgs ev)\r\n bei DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)\r\n bei DevExpress.XtraGrid.Views.Base.Handler.BaseViewHandler.ProcessEvent(EventType etype, Object args)\r\n bei DevExpress.XtraGrid.GridControl.OnMouseDown(MouseEventArgs ev)\r\n bei System.Windows.Forms.Control.WmMouseDown(Message& m, MouseButtons button, Int32 clicks)\r\n bei System.Windows.Forms.Control.WndProc(Message& m)\r\n bei DevExpress.XtraEditors.Container.EditorContainer.WndProc(Message& m)\r\n bei DevExpress.XtraGrid.GridControl.WndProc(Message& m)\r\n bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n bei System.Windows.Forms.Application.Run(ApplicationContext context)\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n bei WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.\r\n bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n bei System.Threading.ThreadHelper.ThreadStart()"
Tabbing out:
" bei DevExpress.XtraGrid.Views.Base.ColumnView.AccessibleNotifyClients(Int32 row, GridColumn focusedCol)\r\n bei DevExpress.XtraGrid.Views.Base.ColumnView.RaiseFocusedColumnChanged(GridColumn prevFocused, GridColumn focusedColumn)\r\n bei DevExpress.XtraGrid.Views.Base.ColumnView.DoAfterFocusedColumnChanged(GridColumn prevFocusedColumn, GridColumn focusedColumn)\r\n bei DevExpress.XtraGrid.Views.Grid.GridView.DoAfterFocusedColumnChanged(GridColumn prevFocusedColumn, GridColumn focusedColumn)\r\n bei DevExpress.XtraGrid.Views.Base.ColumnView.set_FocusedColumn(GridColumn value)\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.DoMoveFocusedColumn(Int32 delta, Boolean autoMoveRowFocus, KeyEventArgs e)\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridRegularRowNavigator.DoNavigation(KeyEventArgs e)\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridRegularRowNavigator.OnKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.ProcessKey(KeyEventArgs e)\r\n bei DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)\r\n bei DevExpress.XtraGrid.Views.Base.Handler.BaseViewHandler.ProcessEvent(EventType etype, Object args)\r\n bei DevExpress.XtraGrid.GridControl.RaiseEditorKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.Container.EditorContainer.DevExpress.XtraEditors.Container.IEditorContainer.OnEditorKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.BaseEdit.OnEditorKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.TextEdit.OnEditorKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.BaseEdit.OnKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.TextEdit.OnMaskBox_KeyDown(Object sender, KeyEventArgs e)\r\n bei System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)\r\n bei DevExpress.XtraEditors.Mask.MaskBox.OnKeyDown(KeyEventArgs e)\r\n bei System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)\r\n bei DevExpress.XtraEditors.Mask.MaskBox.ProcessKeyEventArgs(Message& m)\r\n bei System.Windows.Forms.Control.ProcessKeyMessage(Message& m)\r\n bei System.Windows.Forms.Control.WmKeyChar(Message& m)\r\n bei System.Windows.Forms.Control.WndProc(Message& m)\r\n bei System.Windows.Forms.TextBoxBase.WndProc(Message& m)\r\n bei System.Windows.Forms.TextBox.WndProc(Message& m)\r\n bei DevExpress.XtraEditors.Mask.MaskBox.BaseWndProc(Message& m)\r\n bei DevExpress.XtraEditors.Mask.MaskBox.MaskStrategy.SimpleStrategy.DoWndProc(Message& m)\r\n bei DevExpress.XtraEditors.Mask.MaskBox.WndProc(Message& m)\r\n bei DevExpress.XtraEditors.TextBoxMaskBox.WndProc(Message& msg)\r\n bei System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)\r\n bei System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)\r\n bei System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)\r\n bei System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)\r\n bei System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)\r\n bei System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)\r\n bei System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)\r\n bei System.Windows.Forms.Application.Run(ApplicationContext context)\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun()\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel()\r\n bei Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[] commandLine)\r\n bei WindowsApplication1.My.MyApplication.Main(String[] Args) in 17d14f5c-a337-4978-8281-53493378c1071.vb:Zeile 81.\r\n bei System.AppDomain._nExecuteAssembly(Assembly assembly, String[] args)\r\n bei System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)\r\n bei Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()\r\n bei System.Threading.ThreadHelper.ThreadStart_Context(Object state)\r\n bei System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n bei System.Threading.ThreadHelper.ThreadStart()"
Steps to Reproduce:
- start attached sample application
- expand any master row
- edit one of the values in the price column of the detail gridview
- press tab or click with mouse on another column in detail grid
Actual Results:
NullReferenceException