Dear support team,
I have read lots of posts, but I can't find a reasonable answer.
I am looking to bind a NumericTextbox to a property and get the value while the user is still typing, instead of when the control loses focus. This works perfectly in strings, but not in numbers.
is it possible?
Thanks in advance.
Regards.
I was looking for this too (i'm using 19.xx.xx) and i found this link:
so i used the keypress and made sure my tvalue was int or decimal. works.
Hi Manuel,
Thanks for taking the time to reply.
I've thought about this solution using Regex but I wanted to know if Syncfusion has updated its control to accept this requirement.
Do you have a sample of how you did it?
Best regards.
Hi George Waters,
We have validated your requirement and we suggest using OnInput event which will get triggered on every input from the user.
kindly refer the below snippet for your reference.
|
<SfNumericTextBox TValue="int?" OnInput= "KeyPressed"></SfNumericTextBox>
Value : @value
@code { int value; double val;
public void KeyPressed(ChangeEventArgs args) {
if(double.TryParse(args.Value.ToString(), out val)) { value = int.Parse(args.Value.ToString()); } } } |
If the above solution does not meet your requirements, can you please share more detailed information about your requirements? So, we will check and provide a prompt solution as soon as possible.
Regards,
Mohanraj M
That's the exact solution for what I've been struggling last 2 days.
I'd buy you a beer.
Thanks Mohanraj !!!
George,
Thanks for your update.
Regards,
Sureshkumar P