RadMaskedNumericInput clearbutton on int

2 posts, 0 answers
  1. Fredrik
    Fredrik avatar
    58 posts
    Member since:
    Mar 2013

    Posted 22 Aug 2013 Link to this post

    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?
  2. Pavel R. Pavlov
    Admin
    Pavel R. Pavlov avatar
    1183 posts

    Posted 26 Aug 2013 Link to this post

    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 >>
  3. DevCraft banner
Back to Top