Hello,
I am facing issue On Radzen Numeric while insert/editing value and we have use format in the Numeric component.
When we insert/edit the value with out removing the focus from field if we try to submit it wont take the value which need to insert/update it submits which the old value or null value.
We have also called the numeric format for thousand separator but it doesn't call that formater as well.
The screenshot for the code are as below :
Code :
Submit and Cancel button :
<RadzenButton ButtonType="ButtonType.Submit" Size="ButtonSize.Medium" MouseEnter="@(args => ShowTooltipsave(args) )" Icon="save"
Style="margin-right:5px" />
<RadzenButton Size="ButtonSize.Medium" MouseEnter="@(args => ShowTooltipcancel(args) )" Icon="cancel" Click="@CancelEditIssue" />
Numeric control :
<RadzenNumeric TValue="double?" Disabled=@mode @bind-Value="@issue.RevenueImpact" Change=@(args => OnChange(args, "Rev")) />
OnchangeEvent :
double? OnChange(dynamic e, string changevalue)
{
if (changevalue == "Rev")
{
issue.RevenueImpact = Convert.ToDouble(string.Format("{0:###,#0.0}", e));
return issue.RevenueImpact;
}
else
{
issue.CostImpact = Convert.ToDouble(string.Format("{0:###,#0.0}", e));
return issue.CostImpact;
}
}
Kindly please provide any suggestion on Radzen numeric so that this issue can be resolved
The RadzenNumeric indeed fires its Change event when it loses focus. This is done to mimic the default behavior of the browser change event.
If you need immediate feedback you can use @oninput
as in this demo: https://blazor.radzen.com/numericrangevalidator
Thanks for the response.
-
Instead of using Onchange event we have tired with format event (###,###) on numeric component for thousand seprator but on that as well it was not working as expected.
-
We are still facing the issue with Numeric when the focus is on it and we update the numeric is not getting updated controls which we have used are
<RadzenNumeric TValue="double?" Disabled=@mode @bind-Value="@issue.RevenueImpact" format="###,###"/>
We can't use @oninput event as the functionality is different then we expected.
You can check my reply here. If you want to update a property when the user types you need to use @oninput
. I probably don't understand what you are trying to achieve - if you have a Radzen subscription you can send us your application to info@radzen.com
Hi Korchev,
Thanks for the response. I think i have not explained to you properly but the issue with RadzenNumeric control we are facing is that when we are updating the input value it is getting resetted.
for example,
1)if we are creating a new entry the initial value is null, and when we add new value like 1234 and click on submit button then it gets resetted to null.
2)if we edit the initial value of like 1234 to 7890 and check on submit button then it gets resetted to 1234.
<RadzenNumeric Disabled=@mode @bind-Value="@claim.SubmittedValue" style="width: 100%;color: black" Name="SubmittedValue" ShowUpDown="false" TValue="double?" />
Can you please help on this.
We have also attach the recording video where we are getting this issue.
Meeting with Abhishek-20210525_141133-Meeting Recording.zip (972.0 KB)