Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

MudBlazer and MudNumericField formatted as a currency input validation issue

$
0
0

I have a MudNumericField input on a form and I cant get it to validate a currency value correctly

In my viewModel I have this definition

[Required(ErrorMessage = "A budget value is required")][Display(Name = "Period Budget")][DataType(DataType.Currency)]public decimal? Budget { get; set; } = 0M;

Then in my form I have this

<MudStack Row="true"><MudNumericField Immediate="false" Label="Period Budget Value" Format="C2" Culture="@_en" T="decimal?" @bind-Value="VenueBudget.Budget" For="@(() =>VenueBudget.Budget)" HelperText="Specify period booking budget" /></MudStack>

and in my codebehind page I have this for the CultureInfo

public CultureInfo _en = CultureInfo.GetCultureInfo("en-GB");

Im always getting a formatting error, can anyone see where I'm going wrong ?

enter image description here


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>