This is a migrated thread and some comments may be shown as answers.

Empty text in NumericUpDown issue

1 Answer 253 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Licensing
Top achievements
Rank 1
Licensing asked on 15 May 2012, 09:18 AM
Hello!

We are using MVVM pattern to build our application. One of our views uses number of NumericUpDown controls. If text of some NumericUpDown is set to empty string by user control displays red frame (see screenshot "validation error"). Property definition you can find in screenshot named "amount property".

The problem is that view model is not updated when text is empty and red frame is displayed. E.g. model still contains previous value.

What is correct way to notify View Model about missing data? Keep in mind that we have significant number of views and each contains set of numeric controls.

1 Answer, 1 is accepted

Sort by
0
Georgi
Telerik team
answered on 18 May 2012, 09:24 AM
Hi,

I think that you need to make your property nullable so when you enter null it does not throw a validation error.
I have attached a simple project where instead of public decimal Amount I am using public decimal ?Amount.

Hope this will help.

Kind regards,
Georgi
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
NumericUpDown
Asked by
Licensing
Top achievements
Rank 1
Answers by
Georgi
Telerik team
Share this question
or