This question is locked. New answers and comments are not allowed.
Hello all, I just started using Telerik MVC tools, and I found a problem with CurrencyTextBox I cant solve:
My Model has a field:
And I use it in a form (razor):
But since it is a portuguese/Brazil site, and work with Real (BRL), I changed the Currency.cshtml to:
The problem is the form format my currency ok, but always accuse the value as "not a number" since in pt_BR the comma and point are inverted R$ 10.000,00
How can I solve this? I have lots of currency fields all over my forms.
My Model has a field:
...[Required][Display(Name = "Valor")][DataType(DataType.Currency)]public decimal Valor { get; set; }...And I use it in a form (razor):
...<td> @Html.LabelFor(m => m.Valor)</td><td> @Html.EditorFor(m => m.Valor) <span class="error">@Html.ValidationMessageFor(x => x.Valor)</span></td>...But since it is a portuguese/Brazil site, and work with Real (BRL), I changed the Currency.cshtml to:
@model decimal@(Html.Telerik().CurrencyTextBox() .Name(ViewData.TemplateInfo.GetFullHtmlFieldName(string.Empty)) .InputHtmlAttributes(new {style="width:100%"}) .MinValue(0) .Value(Model) .CurrencySymbol("R$") .DecimalDigits(2) .DecimalSeparator(",") .NumberGroupSeparator(".") .Spinners(false))The problem is the form format my currency ok, but always accuse the value as "not a number" since in pt_BR the comma and point are inverted R$ 10.000,00
| The field Valor must be a number. |
How can I solve this? I have lots of currency fields all over my forms.