I have a UltraNumericEditor:
ultraNumericEditor1.NumericType = NumericType.Double; ultraNumericEditor1.DataFilter = new PercentageDataFilter(); ultraNumericEditor1.MaskInput = "nnn\\%"; ultraNumericEditor1.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always; ultraNumericEditor1.MaxValue = 100; ultraNumericEditor1.FormatString = "##0\\%";
ultraNumericEditor1.NumericType = NumericType.Double;
ultraNumericEditor1.DataFilter = new PercentageDataFilter();
ultraNumericEditor1.MaskInput = "nnn\\%";
ultraNumericEditor1.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;
ultraNumericEditor1.MaxValue = 100;
ultraNumericEditor1.FormatString = "##0\\%";
When I delete all numbers from the control, that exception is raised from i-don't-know-where, but is not my code, and I don't know how avoid it.
How could I avoid the user introduce values with the keyboard? I only want that the user can modify de value with the spin buttons.
Cheers
Are you sure that the exception is not triggered by your DataFilter (i.e. it's in the call stack somewhere)? I haven't hit this error before, and it's hard to say what's going on just with the information that you provided.
-Matt
Hi, it's vtortola from another computer.
I've copied the datafilter from the KB, and the exception is raised before enter inside it. The exception appears in the entry point of the application (Application.Run(new ClientForm())).
I'm very sure that is not in my code :
Find all "section is empty", Match case, Subfolders, Find Results 1, "Entire Solution" Matching lines: 0 Matching files: 0 Total files searched: 479
And the call stack shows that the exception come from Infragistics, take a look:
Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.NumberSection.ToDecimal() + 0x7a bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.NumberSection.CanSpin(bool up = false) + 0x55 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.EditInfo.CanSpin(bool up = false) + 0x1f1 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EditorWithMaskSpinButtonUIElement.CanSpin(System.Windows.Forms.ScrollButton direction) + 0x47 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EditorWithMaskSpinButtonUIElement.PositionChildElements() + 0x1a7 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase controlElement = {Infragistics.Win.UltraWinGrid.UltraGridUIElement}, bool recursive = true) + 0x51 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UIElement.VerifyChildElements(Infragistics.Win.ControlUIElementBase controlElement = {Infragistics.Win.UltraWinGrid.UltraGridUIElement}, bool recursive = true) + 0x9a bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UIElement.VerifyChildElements(bool recursive) + 0x30 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UIElement.VerifyChildElements() + 0xa bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.EditInfo.ScrollDisplayCharIntoView(int index) + 0x86 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.EditInfo.CaretPosition.set(int value) + 0x42 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.EditInfo.Delete(bool emulateDeleteKey) + 0x173 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraWinMaskedEdit.EditInfo.PerformAction(Infragistics.Win.UltraWinMaskedEdit.MaskedEditAction actionCode, bool shift, bool control) + 0x633 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EditorWithMask.OnOwnerKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData = RButton | MButton | Back | Space}) + 0x128 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EmbeddableEditorBase.ProcessOwnerKeyDown(object sender, System.Windows.Forms.KeyEventArgs e) + 0xc bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EmbeddableEditorOwnerBase.RaiseKeyDown(System.Windows.Forms.KeyEventArgs e) + 0x17 bytes Infragistics2.Win.UltraWinGrid.v8.1.dll!Infragistics.Win.UltraWinGrid.UltraGrid.ForwardKeyToEditorHelper(System.Windows.Forms.KeyEventArgs e = {KeyData = RButton | MButton | Back | Space}) + 0xd2 bytes Infragistics2.Win.UltraWinGrid.v8.1.dll!Infragistics.Win.UltraWinGrid.UltraGridUIElement.ProcessKeyDown(System.Windows.Forms.KeyEventArgs e = {KeyData = RButton | MButton | Back | Space}) + 0x75 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.Utilities.ProcessEvent(System.Windows.Forms.Control control = {Infragistics.Win.UltraWinGrid.DKUltraGrid}, Infragistics.Win.ControlUIElementBase.ProcessEvent eventToProcess = KeyDown, System.EventArgs e = {KeyData = RButton | MButton | Back | Space}) + 0x239 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.UltraControlBase.OnKeyDown(System.Windows.Forms.KeyEventArgs e) + 0x30 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessKeyEventArgs(ref System.Windows.Forms.Message m = {msg=0x100 (WM_KEYDOWN) hwnd=0x90bac wparam=0x2e lparam=0x1530001 result=0x0}) + 0x4bc bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ProcessKeyMessage(ref System.Windows.Forms.Message m) + 0x31 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WmKeyChar(ref System.Windows.Forms.Message m = {msg=0x100 (WM_KEYDOWN) hwnd=0x90bac wparam=0x2e lparam=0x1530001 result=0x0}) + 0x12 bytes System.Windows.Forms.dll!System.Windows.Forms.Control.WndProc(ref System.Windows.Forms.Message m) + 0x3ee bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.OnMessage(ref System.Windows.Forms.Message m) + 0xd bytes System.Windows.Forms.dll!System.Windows.Forms.Control.ControlNativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x36 bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 256, System.IntPtr wparam, System.IntPtr lparam) + 0x5a bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m = {msg=0x100 (WM_KEYDOWN) hwnd=0x90bac wparam=0x2e lparam=0x1530001 result=0x0}) + 0xcc bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x5 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.EditorWithMask.AccessibleTextManager.AccessibleTextSubclasser.WndProc(ref System.Windows.Forms.Message msg) + 0x43 bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 256, System.IntPtr wparam, System.IntPtr lparam) + 0x5a bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m = {msg=0x100 (WM_KEYDOWN) hwnd=0x90bac wparam=0x2e lparam=0x1530001 result=0x0}) + 0xcc bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x5 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.FormattedLinkLabel.FormattedLinkEditor.AccessibleTextManager.AccessibleTextSubclasser.WndProc(ref System.Windows.Forms.Message msg) + 0x3d bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.Callback(System.IntPtr hWnd, int msg = 256, System.IntPtr wparam, System.IntPtr lparam) + 0x5a bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DefWndProc(ref System.Windows.Forms.Message m = {msg=0x100 (WM_KEYDOWN) hwnd=0x90bac wparam=0x2e lparam=0x1530001 result=0x0}) + 0xcc bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x5 bytes Infragistics2.Win.v8.1.dll!Infragistics.Win.FormattedLinkLabel.IMENativeWindowManager.IMENativeWindow.WndProc(ref System.Windows.Forms.Message m) + 0x15 bytes System.Windows.Forms.dll!System.Windows.Forms.NativeWindow.DebuggableCallback(System.IntPtr hWnd, int msg = 256, System.IntPtr wparam, System.IntPtr lparam) + 0x57 bytes [Native to Managed Transition] [Managed to Native Transition] System.Windows.Forms.dll!System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(int dwComponentID, int reason = -1, int pvLoopData = 0) + 0x2f1 bytes System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(int reason = -1, System.Windows.Forms.ApplicationContext context = {System.Windows.Forms.ApplicationContext}) + 0x17d bytes System.Windows.Forms.dll!System.Windows.Forms.Application.ThreadContext.RunMessageLoop(int reason, System.Windows.Forms.ApplicationContext context) + 0x53 bytes System.Windows.Forms.dll!System.Windows.Forms.Application.Run(System.Windows.Forms.Form mainForm) + 0x2e bytes > MyApp.exe!DKHost.DKS.Main(string[ args = {Dimensions:[0]}) Line 40 + 0x1a bytes C# [Native to Managed Transition] [Managed to Native Transition] mscorlib.dll!System.AppDomain.ExecuteAssembly(string assemblyFile, System.Security.Policy.Evidence assemblySecurity, string[ args) + 0x39 bytes Microsoft.VisualStudio.HostingProcess.Utilities.dll!Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly() + 0x2b bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart_Context(object state) + 0x3b bytes mscorlib.dll!System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext executionContext, System.Threading.ContextCallback callback, object state) + 0x81 bytes mscorlib.dll!System.Threading.ThreadHelper.ThreadStart() + 0x40 bytes
I don't know how avoid this behavior, could you help me to find a solution?
Cheers.