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

RadMaskedNumericInput clearbutton on int

1 Answer 79 Views
MaskedInput (Numeric, DateTime, Text, Currency)
This is a migrated thread and some comments may be shown as answers.
Fredrik
Top achievements
Rank 2
Fredrik asked on 22 Aug 2013, 10:02 AM
when you try to use the clear button on a RadMaskedNumericInput bound to a integer property it goes out in invalidoperation exception since it try to set the int property to null. it should insted set 0 when clearbutton is acitvated.

is this a flaw, or is there someway to configure this?

1 Answer, 1 is accepted

Sort by
0
Pavel R. Pavlov
Telerik team
answered on 26 Aug 2013, 02:07 PM
Hello Fredrik,

As far as I understand, you have bound the Value property of the RadMaskedNumericInput control to a property of type int in your ViewModel and the VS throws an exception when you press the ClearButton. Please note that the Value property of the RadMaskedNumericInput control is of type int? (nullable int) and we decided to set the Value to null after the user presses the ClearButton because if we set the Value to 0 (or any other value) you will not be able to understand (in code) if the user has entered that value or (s)he has pressed the ClearButton.

Furthermore, the ClearButton replaces the editable positions with placeholders. If you need to customize this behavior you can derive our control and override the HandleClearOverride() method and set the Value to what you need (e.g. 0).

Regards,
Pavel R. Pavlov
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for SILVERLIGHT.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
Tags
MaskedInput (Numeric, DateTime, Text, Currency)
Asked by
Fredrik
Top achievements
Rank 2
Answers by
Pavel R. Pavlov
Telerik team
Share this question
or