In an application I'm developing, I've got multiple numericeditors which are set to display double values. When I type in a large number like 10245, the editor places a dot in between every three numbers. That's fine, but I don't want to dot there.
I've read things about NumberGroupSeperator but that seems to apply to the webnumericeditor control. How can I set the numberformat for the ultranumericeditor to not display any character between three digits? And even better: is it possible to alter the NumberFormat object of the Thread.CurrentThread object so none of the numericcontrols display this character?
You can edit the NumberFormat in the CurrentThread culture objects or set a new CultureInfo object if you wish to. Therefore I thought this would be the way of altering the NumberGroupSeperator for all controls but unfortunately the Infragistics controls don't seem to use this value.
Thanks for the code though, that does make it a bit easier :)
Off the top of my head, I can't think of a single global setting that would take care of this, since I don't think that you can alter the settings of the CultureInfo.CurrentCulture. One workaround you might be able to implement to save time would be to override the OnControlAdded method of your Form and set the MaskInpu there, such as:
protected override void OnControlAdded(ControlEventArgs e){ base.OnControlAdded(e); if (e.Control is UltraNumericEditor) ((UltraNumericEditor)e.Control).MaskInput = "nnnnnnn.nn";}
-Matt
That would mean I'd have to do that for every editor on all of my forms. Isn't there a way to globally take care of this in the entire app?
You should be able to get rid of the numeric separator without delving into the various regional/cultural settings, assuming that you always want this behavior to occurs. To do this, use the MaskInput property of the editor; a sample mask would be "nnnnnnn.nn", which would allow two decimal places and a maximum value of 9999999.99. You can add commas to the mask to show the numeric separator if you want at certain places.