Hello,
I have a UltraNumericEditor and I need to define a MaskInput that doesn't limit the number of digits but it Throws an Exception.
private UltraNumericEditor setControlToNumeric(NumericType type) { string i = Int32.MaxValue.ToString(); string f = Int32.MaxValue.ToString();
UltraNumericEditor numericEditor = new UltraNumericEditor(); numericEditor.MinValue = Int64.MinValue; numericEditor.MaxValue = Int64.MaxValue; numericEditor.NumericType = type; numericEditor.PromptChar = ' ';
if (type == NumericType.Decimal) numericEditor.MaskInput = "{double:" + i + "." + f + "}"; else if (type == NumericType.Integer) numericEditor.MaskInput = "{LOC}" + i;
return numericEditor;
}
Can you please tell me what I'm doing wrong?
Thank you.
Best regards,
Maria
Hello Maria,
I tried this and it always works fine for me so I attached my sample to this post for you. Please review it and feel free to let me know if I misunderstood you or if you have any other questions.
It works fyne for you because you're creating a Editor with NumericType.Double and it must be NumericType.Decimal...
If you do that, it will have problems..
I tried it, I used decimal and I did not get any exceptions. You could try that in my sample. I attached the sample with the modification for you. Please take a look and test.
It set me the OutOfRange Exception.I tried this solution: numericEditor.MaskInput = "{double:29.19}"; and it doesn't work as well.
I really don't no what else to do about it... Any ideas?
Thank you-.
I was able to solve my problem by reading the page that you suggest me.
thank you,
best regards,
I am checking about the progress of this issue. Please let me know If you need any further assistance on this.
Please take a look at the following link and especially at the 'Precision':
http://msdn.microsoft.com/en-us/library/364x0z75(v=vs.100).aspx.
Please do not hesitate to contact me if you need any additional assistance.