Sep 11, 2015, 10:01 AM
TextField rounds number strings problem
Hi,
I'm creating a textfield with string values, the values are numbers with 17chars, but I'm facing a problem that the textfiled seems to convert them to int as a numberfield and rounds the last 3 numbers as below C# code and the string example:
First I create a PropertyGridParameter and then add the textfield to it with the dunamic values. It saves the right values to the DB but the viewing values get rounded.![Click image for larger version.
Name: extnet-textfield1.png
Views: 183
Size: 9.2 KB
ID: 24223](https://forums.ext.net/attachment.php?attachmentid=24223&d=1441965608&thumb=1)
![Click image for larger version.
Name: extnet-textfield2.png
Views: 163
Size: 9.1 KB
ID: 24224](https://forums.ext.net/attachment.php?attachmentid=24224&d=1441965620&thumb=1)
789124893465912650
Get rounded to:
789124893465912700
At last I added EnforceMaxLength and MaxLength 40 but it didn't help. Any idea?
I'm creating a textfield with string values, the values are numbers with 17chars, but I'm facing a problem that the textfiled seems to convert them to int as a numberfield and rounds the last 3 numbers as below C# code and the string example:
First I create a PropertyGridParameter and then add the textfield to it with the dunamic values. It saves the right values to the DB but the viewing values get rounded.
var parameter = new Ext.Net.PropertyGridParameter()
{
DisplayName = GetLangText(prop.PropertyDesc),
Name = prop.PropertyId.ToString(),
Value = companyProp != null ? companyProp.PropertyValue : null
};
var textField = new Ext.Net.TextField();
textField.EnforceMaxLength = true;
textField.MaxLength = 40;
textField.ID = "TextField_" + prop.PropertyId;
parameter.EditorType = Ext.Net.PropertyGridEditorType.String;
parameter.Editor.Add(textField);
The string value is:789124893465912650
Get rounded to:
789124893465912700
At last I added EnforceMaxLength and MaxLength 40 but it didn't help. Any idea?