D'Arcy from Winnipeg
Musings of a Canadian BizTalk and SOA Developer

Infragistics WebNumericEdit - How to change the Group Seperator

Tuesday, October 09, 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

Post a comment





 

Please add 6 and 3 and type the answer here: