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;