Empty text in NumericUpDown issue

2 posts, 0 answers
  1. Licensing
    Licensing avatar
    31 posts
    Member since:
    Sep 2011

    Posted 15 May 2012 Link to this post


    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.
  2. Georgi
    Georgi avatar
    344 posts

    Posted 18 May 2012 Link to this post


    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,
    the Telerik team

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

  3. DevCraft R3 2016 release webinar banner
Back to Top