I just updated 2008.1 to 2008.2 + latest Aug hotfix. And now none of our custom controls that use ComboEditor are working with KeyDown events.
"Object reference not set to an instance of an object." but my object list is initialized and working. The only code to change is upgrading. When I revert to 2008.1 everything works fine. WTH!
Ideas from support on how to get around this?
-Ken
at Infragistics.Win.EditorWithCombo.InternalOnEmbeddableTextBoxListenerKeyDown(KeyEventArgs e)at Infragistics.Win.EditorWithCombo.Infragistics.Win.IEmbeddableTextBoxListener.OnKeyDown(KeyEventArgs e)at Infragistics.Win.UltraWinEditors.UltraComboEditor.OnEditorKeyDown(KeyEventArgs args)at Infragistics.Win.UltraWinEditors.TextEditorControlBase.OnEditorKeyDown(Object sender, KeyEventArgs args)at Infragistics.Win.EmbeddableEditorBase.RaiseKeyDownEvent(KeyEventArgs e)at Infragistics.Win.EmbeddableTextBox.OnKeyDown(KeyEventArgs e)at System.Windows.Forms.Control.ProcessKeyEventArgs(Message& m)at System.Windows.Forms.Control.ProcessKeyMessage(Message& m)at Infragistics.Win.EmbeddableTextBoxWithUIPermissions.ProcessKeyMessage(Message& msg)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 Infragistics.Win.EmbeddableTextBoxWithUIPermissions.WndProc(Message& m)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 Cbs.Ibs.SalesDesktop.Program.Main() in D:\Dev\IBS\1.4\Clients\SmartClient\SalesDesktop\SalesDesktop\Program.cs:line 27at System.AppDomain._nExecuteAssembly(Assembly assembly, String[ args)at System.AppDomain.nExecuteAssembly(Assembly assembly, String[ args)at System.Runtime.Hosting.ManifestRunner.Run(Boolean checkAptModel)at System.Runtime.Hosting.ManifestRunner.ExecuteAsAssembly()at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext, String[ activationCustomData)at System.Runtime.Hosting.ApplicationActivator.CreateInstance(ActivationContext activationContext)at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssemblyDebugInZone()at System.Threading.ThreadHelper.ThreadStart_Context(Object state)at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)at System.Threading.ThreadHelper.ThreadStart()
Hi Sylvain,
What you're doing here is a bit unusual, since you are implementing IProvidesEmbeddableEditor yourself and returning the editor from an UltraComboEditorControl that you are using internally.
Why not simply use an UltraComboEditor with a button in the ButtonsRight collection that shows a tree? Or even derive a class from UltraComboEditor and have it add a button and a tree? It seems like that would be safer and simpler than what you have here.
It's also a bit odd that you are returning the Editor of an UltraComboEditor control. You should probably just be using an EditorWithCombo rather than an UltraComboEditor. You don't really need a control here and I'm not sure that the UltraComboEditor.Editor is correct and can be used by the grid.
Having said that, none of that appears to be what's causing the exception.
What's happening here is that you have essentially applied an EditorWithCombo to the grid column and when you press the down arrow, the editor is trying to select the next item in the ValueList. But your grid column has no ValueList.
The grid should be checking for this and not blowing up, so I consider this a bug and I'm going to forward this thread over to Infragistics Developer Support so they can write it up for developer review and get it fixed.
You work around this in the mean time by just applying an empty ValueList to the grid column.
private void ultraGrid1_InitializeLayout(object sender, InitializeLayoutEventArgs e) { e.Layout.Bands[0].Columns["Tester"].ValueList = new ValueList(); }
I've re-created the bug with a sample app. The exception occurs when the focus is into a cell of the column that holds the DropDownTreeView and the Top or Down arrow key are pressed. The Right and Left arrow key move the cursor inside the grid cell without any exception.
In an ideal world, the grid cell would be a DropDownList that doesn't allow text editing. Only selecting from the TreeView.
I've attached the sample with the post.
Thanks for your time.
Sylvain
Hi,
It's hard to say from just a call stack. Can you duplicate this exception in a small sample project and post it here so I can take a look? You can attach a file to your post on the Options tab.
You probably want your up and down arrows to put focus on the tree control and select items from the tree, anyway. So you will need to trap the key events and handle those keys before the grid or the editor handle them.
But if the left and right arrows are blowing up, then something is wrong there.
Using NetAdvantage 2010 volume 2.
Is there an update, because I ran into the same issue.
I've created a UserControl which is composed of a UltraComboEditor with a RightButton that holds a Treeview ... When the UserControl is used into an UltraGrid has an EditorComponent for a specific Column, I have the following Exceptions when I hit any of the arrow key (Left, Up, Right, Down).
Any ideas on what is wrong here?
************** Exception Text **************
System.NullReferenceException: Object reference not set to an instance of an object.
at Infragistics.Win.EditorWithCombo.InternalOnEmbeddableTextBoxListenerKeyDown(KeyEventArgs e)
at Infragistics.Win.EditorWithCombo.Infragistics.Win.IEmbeddableTextBoxListener.OnKeyDown(KeyEventArgs e)
at Infragistics.Win.EditorWithCombo.OnOwnerKeyDown(KeyEventArgs e)
at Infragistics.Win.EmbeddableEditorBase.ProcessOwnerKeyDown(Object sender, KeyEventArgs e)
at Infragistics.Win.EmbeddableEditorOwnerBase.RaiseKeyDown(KeyEventArgs e)
at Infragistics.Win.UltraWinGrid.UltraGrid.ForwardKeyToEditorHelper(KeyEventArgs e)
at Infragistics.Win.UltraWinGrid.UltraGridUIElement.ProcessKeyDown(KeyEventArgs e)
at Infragistics.Win.Utilities.ProcessEvent(Control control, ProcessEvent eventToProcess, EventArgs e)
at Infragistics.Win.UltraControlBase.OnKeyDown(KeyEventArgs e)
at System.Windows.Forms.Control.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.Control.ControlNativeWindow.OnMessage(Message& m)
at System.Windows.Forms.Control.ControlNativeWindow.WndProc(Message& m)
at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
Hi Ken,
Can you duplicate this in a small sample project? If so, you should Submit an incident to Infragistics Developer Support so they can check it out and get it corrected.
My guess is that this has something to do with the AutoCompleteMode property that was added in v8.2. But if this used to work and now it raises an exception, it's a bug and needs to be fixed.