Hi ,
We are running into an exception when using UltraGrid. Basically we have placed an drop drown in one of columns by changing its style to combo box. Once the selection of the combo box happens (trapped via cellchange event), we take the user to another screen in our UI. that the high level picture of what we are doing. we are seeing following exception coming from infragistics code.
If (e.Cell.Column.Index = 1) Then
If (e.Cell.Text.Equals("Create New Template")) Then
Dim apppath As String = System.AppDomain.CurrentDomain.BaseDirectory.ToString
apppath = apppath + "NewDocument.doc"
mailMergeTemplate.MMTPath = apppath
RaiseEvent EditMailMergeTemplate(Me, New EditTemplateEventArgs(mailMergeTemplate))
Exception Is:-
Object reference not set to an instance of an object. (Infragistics2.Win.v8.1)
------------------------------Program Location:
at Infragistics.Win.EditorWithCombo.Infragistics.Win.IValueListOwner.OnSelectionChangeCommitted() at Infragistics.Win.ValueList.ProcessSelectionChangeCommitted() at Infragistics.Win.ValueListDropDown.OnSelectionChangeCommitted() at Infragistics.Win.ValueListDropDown.SelectItemByMouse(ValueListItem valueListItem) at Infragistics.Win.ValueListDropDown.OnMouseUp(MouseEventArgs e) at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks) at System.Windows.Forms.Control.WndProc(Message& m) at Infragistics.Win.ValueListDropDownUnsafe.WndProc(Message& message) 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(ApplicationContext context) at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.OnRun() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.DoApplicationModel() at Microsoft.VisualBasic.ApplicationServices.WindowsFormsApplicationBase.Run(String[ commandLine) at SDP.Win.Application.My.MyApplication.Main(String[ Args)
Waiting your response,
Ngaheer
Well, if you want to try to work around the issue, what I would do is - don't call your code directly from the CellChange event. Instead, usea BeginInvoke to call a method that does what you want. That way, the CellChange event will be finished with whatever it needs to do before your code fires.
Hi Ngaheer,
I tried this out briefly, but I was unable to duplicate the error. There are quite a few unknowns here, though, like how you are setting up the list in the grid column and what event(s) you are handling.
My guess is that something you are doing is causing the dropdown to be closed and possibly disposed while it is still in the middle of processing the selection. If that's the case, then it's possible that it's a bug in the control, because the control should try to handle these sorts of cases more gracefully, rather than raising an exception, if possible. But without seeing the issue in action, I can't be sure.
I recommend that you try to duplicate the exception in a small sample project and then Submit an incident to Infragistics Developer Support. If they can duplicate the issue, they can write it up for developer review and hopefully get it fixed.