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

Masked textbox combined with numeric textbox spinner

3 Answers 197 Views
Input
This is a migrated thread and some comments may be shown as answers.
Martin
Top achievements
Rank 1
Martin asked on 31 May 2012, 03:14 PM
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?

3 Answers, 1 is accepted

Sort by
0
Richard
Top achievements
Rank 1
answered on 04 Jun 2012, 08:12 PM
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!
0
Martin
Top achievements
Rank 1
answered on 18 Jun 2012, 08:55 AM
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?
0
Vasil
Telerik team
answered on 21 Jun 2012, 08:26 AM
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.
Tags
Input
Asked by
Martin
Top achievements
Rank 1
Answers by
Richard
Top achievements
Rank 1
Martin
Top achievements
Rank 1
Vasil
Telerik team
Share this question
or