We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date
close icon

SfNumericTextBox can't be empty!

Hi;


I can't set  SfNumericTextBox  value to null or text to empty string .

It always goes back to the last value (or min value) after losing focus, but a bindingSource can set it to empty.

myNumericTextBox.AllowNull = true;

myNumericTextBox
.Text = "";

or

myNumericTextBox
.Value= null;

or

myNumericTextBox .ResetText();


thanks.


5 Replies 1 reply marked as answer

HN Harinath Navaneethakrishnan Syncfusion Team October 6, 2022 05:45 PM UTC

Hi Ehs Psy,


We are unable to reproduce the issue at our end; however, we've created a sample based on your requirement. please provide more details about the requirement,

or modify our sample and revert to us with a reproducible issue or video. So, it will be helpful to prompt the solution further.


Regards,

Harinath N



Attachment: SfNumericTextBoxNull_274e40d.zip


MQ Milone Qeen October 8, 2022 12:11 PM UTC

if (numericBox.Value == null) 
{
  viewModel.Numeric = null;
}
else 
{
  viewModel.Numeric = (double?)(numericBox.Value);
}
Click here

Marked as answer

HN Harinath Navaneethakrishnan Syncfusion Team October 10, 2022 02:03 PM UTC

Hi Milone,


We are not able to access the link that you have shared, we have requested for access. We appreciate your patience until then.


Regards,

Harinath N




EP ehs psy October 12, 2022 08:05 AM UTC

Hi;

Thanks for the reply.

So, I Need to change the value on the dataset to DBnull by myself to get  the SfNumericTextBox to be empty then.

O.K.




HN Harinath Navaneethakrishnan Syncfusion Team October 12, 2022 12:32 PM UTC

Hi Ehs psy,


Can you please confirm whether the issue is resolved? Please revert us if you need any further assistance.



Regards,

Harinath N



Loader.
Live Chat Icon For mobile
Up arrow icon