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

UpDown on Time/Duration

1 Answer 118 Views
NumericUpDown
This is a migrated thread and some comments may be shown as answers.
Philip Ashworth
Top achievements
Rank 1
Philip Ashworth asked on 25 Jan 2010, 11:20 AM
Hi,

I have a requirement to show a duration i.e. 00:01:00 and then use a up down button to increase the seconds/minutes or hours.

I also want to allow the user to type in a duration i.e. 01:10:00 but have the format restricted so that they can't type chars.

Will the NumericUpDown or an Editor do this?

Thanks Phil.

1 Answer, 1 is accepted

Sort by
0
Bobi
Telerik team
answered on 26 Jan 2010, 03:09 PM
Hello Philip,

RadNumericUpDown can handle only numbers, it is not suitable for your requirement. I suppose that RadMaskedTextBox would be more appropriate for your scenario.
You can use something like the following:
<StackPanel x:Name="LayoutRoot">
        <telerik:RadMaskedTextBox x:Name="text" MaskType="DateTime" Mask="T" />
        <Button Content="UP" Click="ButtonUP_Click"/>
        <Button Content="Down" Click="ButtonDOWN_Click"/>
    </StackPanel>
private void ButtonUP_Click(object sender, RoutedEventArgs e)
        {
            this.text.CallSpin(true);
        }
 
        private void ButtonDOWN_Click(object sender, RoutedEventArgs e)
        {
            this.text.CallSpin(false);
        }

I hope that this will help you.
Please let us know if you have any other questions or need some more help.

Regards,
Boryana
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
NumericUpDown
Asked by
Philip Ashworth
Top achievements
Rank 1
Answers by
Bobi
Telerik team
Share this question
or