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
Thanks I was wondering about that since the first form load seemed to take the longest. Unfortunately, NGen'ing the app isn't possible since it requires administrator permissions on the local PC and I am using ClickOnce. My understanding is it does a separate install per user so I couldn't even have an admin go in and NGen the assemblies. I'll play around a bit and post a new thread if I come up with anything good.
Part of that lag could certainly be related to some exceptions that are handled internally, but another source of lag could be that when the form first loads, .NET needs to JIT compile each of the Infragistics assemblies, which could lead to some delay. One way to test if this is the case is to create a new parent form with no Infragistics controls in it, then have a button that opens your form that does have the controls in it. If there is a delay the first time you show the child form and not the second time, then you could likely assume that most of it comes from the JITing of the assemblies (and subsequently loading them into memory). You can cut down on this by running ngen on the Infragistics assemblies.
-Matt
Matt, thanks for following up on this. I know the code will run but I was working my way through your postings on speeding up my controls as I am having trouble with a short lag the first time my form opens. One of your reccomendations was to set it to break on all errors and try to get rid of any exceptions.
Sorry about the confusion there, I guess that the point is moot about preventing the user from editing directly.
Regarding the first chance exceptions, these are only hit because you have the Visual Studio debugger set to break on all exceptions, but these exceptions are handled within the Infragistics code and so shouldn't really be affecting your application. I ran the application with the debugger set to break on all exceptions and the only exception I got was the "Section is empty" exception at this point, but looking at the code it seems like in this particular case we should be able to prevent this exception from being thrown internally. I've forwarded this thread to Developer Support so that it can be looked into.
Update: I commented out your datafilter code and I still get the exception.