I have a Visual Studio 2008 application targeting Dot 3.5 using Dev Express v2012 version 2.16. In my application I have a GridControl with a master-detail relationship where the GridControl is configured to Auto-Zoom the detail.
When I expand the Customer master record, the Part Number detail GridView is displayed. When in the Part Number GridView I am able to do everything except post data changes. There are two problems.
One, if I select a cell, modify the data, and the use the up or down arrow key to scroll off the current record and thus fire the RowUpdated event the follow except is thrown
=======
System.NullReferenceException was unhandled
Message="Object reference not set to an instance of an object."
Source="DevExpress.XtraGrid.v12.2"
StackTrace:
at DevExpress.XtraGrid.Views.Grid.Handler.GridRegularRowNavigator.OnKeyDown(KeyEventArgs e)
at DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.OnKeyDown(KeyEventArgs e)
at DevExpress.XtraGrid.Views.Grid.Handler.GridHandler.ProcessKey(KeyEventArgs e)
at DevExpress.Utils.Controls.BaseHandler.ProcessEvent(EventType etype, Object args)
at DevExpress.XtraGrid.Views.Base.Handler.BaseViewHandler.ProcessEvent(EventType etype, Object args)
at DevExpress.XtraGrid.GridControl.RaiseEditorKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.Container.EditorContainer.DevExpress.XtraEditors.Container.IEditorContainer.OnEditorKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.BaseEdit.OnEditorKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.TextEdit.OnEditorKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.BaseEdit.OnKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.TextEdit.OnMaskBox_KeyDown(Object sender, KeyEventArgs e)
at System.Windows.Forms.Control.OnKeyDown(KeyEventArgs e)
at DevExpress.XtraEditors.Mask.MaskBox.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)
at DevExpress.XtraEditors.Mask.MaskBox.ProcessKeyEventArgs(Message& m)
at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)
at System.Windows.Forms.Control.WmKeyChar(Message& m)
at System.Windows.Forms.Control.WndProc(Message& m)
at System.Windows.Forms.TextBoxBase.WndProc(Message& m)
at System.Windows.Forms.TextBox.WndProc(Message& m)
at DevExpress.XtraEditors.Mask.MaskBox.BaseWndProc(Message& m)
at DevExpress.XtraEditors.Mask.MaskBox.MaskStrategy.SimpleStrategy.DoWndProc(Message& m)
at DevExpress.XtraEditors.Mask.MaskBox.WndProc(Message& m)
at DevExpress.XtraEditors.TextBoxMaskBox.WndProc(Message& msg)
at System.Windows.Forms.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(Int32 dwComponentID, Int32 reason, Int32 pvLoopData)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
at System.Windows.Forms.Application.Run(Form mainForm)
at WindowsFormsApplication1.Program.Main() in D:\VSN2008\MyDocuments\Projects\Net35\TestWindowsFormsApplication\WindowsFormsApplication1\Program.cs:line 17
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:
=======
Two, if I select a cell, modify the data, and use a ControlNavigator’s EndEdit button to post the data change, while the data posts, the GridControl closes the Part Number GridView detail and reverts to displaying the Customer master GridView, which should not happen.
Both these issues need to be fixed. Neither of these issues existed in Dot Net 2.0 using Dev Express v2011 version 1.10. When I reverted my current Dot 3.5 / DevX 12.2.16 application back to Dot Net 2.0 / DevX 11.1.10 both problems above went away. In addition, I have an older, existing, similar Dot 2.0 / DevX 11.1.10 application that works fine as well, which is what prompted me to revert my current application back to Dot Net 2.0 / DevX 11.1.10 in the first place.
I am attaching a sample (or will when you request it… this won't go through with the sample attached). I hate to have to mark this as urgent, but I don’t want to deliver my current customer project as a Dot 2.0 / DevX 11.1.10 application.
Any help with this will be appreciated.
Thanks,
Vince
Tried to attach sample with this comment, but it won't work either.
Hello,
We are working on this issue, but we need additional time to reproduce it on our side and find an answer. We will come back to this ticket as soon as we can. We appreciate your patience.
Probably, you cannot attach a project because it is quite large. It would be great if you can isolate the issue in a small project.
Hi Vince,
Thank you for your patience. I can't reproduce this issue on my side. I have attached my project. Test how it works on your side. Is the issue reproducible with it? We had a similar issue before. Review the NullReferenceException when editing in an detail grid and reloading datasource ticket. In that ticket, the cause of the issue was that the Grid data source was changed in the data source' ListChanged event handler. This broke the normal Grid behavior. Check if you have similar code in your project. If it's not the case, please provide us with a small project that illustrates the issue.
I have downloaded your example but still cannot attach mine. How small does it have to be? Everything is in a zip file that is all of 264 KB.
Your example is not posting data changes. My app posts data changes to the database in the GridView's RowUpdated event. This works fine using DevExpress v2011 version 1.10. Use DevExpress v2012 version 2.7 to 2.16, that exact same code causes access violations and diplay glitches. Didn't try DevExpress versions in between, so I'm not sure where/when the master/detail quit working as it did in 11.1.10.
Please let me know how to submit my sample.
Thanks.