D'Arcy from Winnipeg
Solution Architecture, Business & Entrepreneurship, Microsoft, and Adoption

Infragistics WebNumericEdit - How to change the Group Seperator

Tuesday, October 9, 2007 9:57 AM

By default the WebNumericEdit control will use a comma to seperate number groups. For example:

1898898

will display as

1,898,898

But sometimes you want to use the control for restricting numeric entry, but its not a "number" in the above sense; its a tracking number, a product number, etc. It needs to be a numeric value without caring about the hundreds, thousands, etc.

There's no obvious way to change this with the control from the designer though. You can alter it in the code behind however:

First add a using statement for System.Globalization. Then, use the following code:

NumberFormatInfo

That's all there is to it.

D

numInfo = new NumberFormatInfo();
numInfo.NumberGroupSeparator =
"";
this.numericEdit.NumberFormat = numInfo;


Feedback

# re: Infragistics WebNumericEdit - How to change the Group Seperator

Brilliant. Infragistics should really have an option for this.

Good Job 10/18/2007 2:40 PM | Connor Murphy

# re: Infragistics WebNumericEdit - How to change the Group Seperator

Great work :), I've spent almost 1 hr to dug it out and at last find it here. 6/17/2008 5:01 AM | Rizwan Ahmed Butt

# re: Infragistics WebNumericEdit - How to change the Group Seperator

So many thanks for this. That's right Connor, why Infragistics don't have this property in the design editor !? 2/4/2009 10:32 AM | Mark

Post a comment