Masked textbox combined with numeric textbox spinner

4 posts, 0 answers
  1. Martin
    Martin avatar
    2 posts
    Member since:
    May 2012

    Posted 31 May 2012 Link to this post

    Does anyone know if it's possible to combine the RadMaskedTextbox with the spinner control that's on the RadNumericTextbox? I'm trying to replace a JQuery UI time picker, that implements a masked input and a spinner, with a Telerik alternative.

    I've got the easy bit done...

    <telerik:RadMaskedTextBox runat="server" ID="RadMaskedTextBox1" Mask="<0..23>:<0..59>">
    </
    telerik:RadMaskedTextBox>

    and as far as I can see there isn't an option to enable the spinner, but if anyone can suggest a solution I would be eternally grateful!

    Is there a way to bind the cursor key up/down event to a button click?
  2. jumpstart
    jumpstart avatar
    479 posts
    Member since:
    Nov 2011

    Posted 04 Jun 2012 Link to this post

    Martin:

    IsSpinEnabled: If you want to disable/enable the spinning behavior of RadMaskedTextBox you can use IsSpinEnabled. By default this property is set to true. Note that only Numeric and DateTime MaskTypes support spinning.

    Hope this helps!
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Martin
    Martin avatar
    2 posts
    Member since:
    May 2012

    Posted 18 Jun 2012 Link to this post

    Hi Jumpstart,

    Sorry for the late replay, the forum has had a problem so I was just getting an error whenever I tried to add a response in the last two weeks.

    IsSpinEnabled isn't an option I'm seeing on the ASP.NET Ajax RadMaskedTextbox (doesn't come up in IntelliType and if I manully add it then it's just ignored). I'm using version Q1 2012 (1.411.40), what version are you using to be seeing it?
  5. Vasil
    Admin
    Vasil avatar
    1547 posts

    Posted 21 Jun 2012 Link to this post

    Hi Martin,

    By design the masked text box does not have spin buttons, they are only available for the NumericTextBox. You will need to add them manually in your page.
    The easiest way is to wrap the MaskedTextBox into user control. Place 2 buttons after it and style them. Then attach JavaScript OnMouseDown handler for the buttons and in this handlers find the masked text box and increase/decrease its value. Do not forget to parse the value to Float or Int, because the value of MaskedTextBox is string, and not a number.

    All the best,
    Vasil
    the Telerik team
    If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
Back to Top