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

Validate On exception without crashing

1 Answer 63 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Minh
Top achievements
Rank 1
Minh asked on 11 Sep 2015, 07:21 PM

My error prompt works well, when it's outside of the range it prompts the error message. If there a way to have it prompt the message and not stop code from running?

 

public string Nint
        {
            get
            {
                return _nint;
            }
            set
            {
                if(double.Parse(value) > (double) Product.MaximumRate || (double.Parse(value) < (double) Product.MinimumRate))
                {
                    NintErrorEnabled = true;
                    throw new ValidationException();
                }

                 NotifyOfPropertyChange();
            }
        }

 

"throw new ValidationException();" stops the code right in it's track. Could I still display the error message without stopping the code? 

1 Answer, 1 is accepted

Sort by
0
Martin Ivanov
Telerik team
answered on 16 Sep 2015, 03:54 PM
Hello Minh,

You can take a look at the Throwing Validation Exceptions help article that explains how to handle the excpetions validation in the masked input suite. I hope this article is helpful.

Regards,
Martin
Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Minh
Top achievements
Rank 1
Answers by
Martin Ivanov
Telerik team
Share this question
or