Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
179
UltraNumericEditor gives FormatException when SpinIncrement set
posted

I'm having a problem with the ultraNumeric Editor with the following settings:

this.ultraNumericEditor1.AlwaysInEditMode = true;

this.ultraNumericEditor1.FormatProvider = new System.Globalization.CultureInfo("en-US");

this.ultraNumericEditor1.FormatString = "###.# MHz";

this.ultraNumericEditor1.Location = new System.Drawing.Point(124, 73);

this.ultraNumericEditor1.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;

this.ultraNumericEditor1.MaskInput = "nnn.n MHz";

this.ultraNumericEditor1.MaxValue = 600;

this.ultraNumericEditor1.MinValue = 0;

this.ultraNumericEditor1.Name = "ultraNumericEditor1";

this.ultraNumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.Double;

this.ultraNumericEditor1.PromptChar = ' ';

this.ultraNumericEditor1.Size = new System.Drawing.Size(100, 21);

this.ultraNumericEditor1.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;

this.ultraNumericEditor1.SpinIncrement = 1;

this.ultraNumericEditor1.TabIndex = 0;

 This will throw a System.FormatException before the form displays complaining that the input string was not in a correct format.  If I remove the SpinIncrement settting then everything is fine.  What I would like to do is use the SpinIncrement to increment the number by some fractional amount, like 1.5.  Am I mis-interpreting the SpinIncrement here?  This only seems to appear when using the literals? in the MaskInput and FormatString.  The following code works fine:

this.ultraNumericEditor1.AlwaysInEditMode = true;

this.ultraNumericEditor1.FormatProvider = new System.Globalization.CultureInfo("en-US");

this.ultraNumericEditor1.FormatString = "###.#";

this.ultraNumericEditor1.Location = new System.Drawing.Point(124, 73);

this.ultraNumericEditor1.MaskClipMode = Infragistics.Win.UltraWinMaskedEdit.MaskMode.Raw;

this.ultraNumericEditor1.MaskInput = "nnn.n";

this.ultraNumericEditor1.MaxValue = 600;

this.ultraNumericEditor1.MinValue = 0;

this.ultraNumericEditor1.Name = "ultraNumericEditor1";

this.ultraNumericEditor1.NumericType = Infragistics.Win.UltraWinEditors.NumericType.Double;

this.ultraNumericEditor1.PromptChar = ' ';

this.ultraNumericEditor1.Size = new System.Drawing.Size(100, 21);

this.ultraNumericEditor1.SpinButtonDisplayStyle = Infragistics.Win.ButtonDisplayStyle.Always;

this.ultraNumericEditor1.SpinIncrement = 1.5;

this.ultraNumericEditor1.TabIndex = 0;

Is there a way to get this to work the way I want?

 

Thanks

Parents Reply Children
No Data