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

Time control

3 Answers 162 Views
MaskedEditBox
This is a migrated thread and some comments may be shown as answers.
Jaymie
Top achievements
Rank 1
Jaymie asked on 19 May 2010, 11:14 AM
So, here goes.

I have a user requirement. The basically need 1 textbox, it doesnt matter if it is a masked textbox or a datetimepicker or whatever.
This textbox needs to allow only hh:mm and when it gains focus it needs to select the whole of the contents.

When the user navigates to this textbox initially, it should be blank (it can be __:__ if masked) and should allow a user to type:

0125

without needing to press any other keys (01 is the hours and 25 is the minutes). The control should be smart enough to display 01:25 but not require the user to press the arrow keys to move from hours to minutes.

I have tried this using the maskededitbox and found that it doesnt work as intended and I cant clear the text if I set the mask to ##:## which is annoying. I then used the datetimepicker and selected time, but it has hh:mm:ss and to get from hours to minutes you have to use the arrow key.

Any help you can give would be greatly appreciated.

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 25 May 2010, 11:46 AM
Hello Jaymie,

Thanks for contacting us and for the details on your case.

Currently, RadMaskedEditBox does not fully support the described behavior. You can set the MaskType to DateTime and set the Mask to HH:MM. This will restrict the input only to valid time in 24 hour format. However, you cannot show '_' placeholders in this case.

Also, when typing you should manually switch to the minutes part of the input to edit it. The control does not automatically do this out of the box.

Since your requirements are interesting, we will put them in our TODO list and will try to implement them as soon as possible. You can track the status of this request via our Public Issue Tracking System:
http://www.telerik.com/support/pits.aspx#/public/winforms/2238

Do not hesitate to write back in case you have further questions or need assistance.

Kind regards,
Deyan
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
0
Ali
Top achievements
Rank 1
answered on 30 Jan 2017, 07:54 PM

Try this

<body>
    <input id="datepicker2" />
    <script>
      $(function() {


        //combine MaskedTextBox with DatePicker (officially unsupported)
        var datepicker2 = $("#datepicker2");

        datepicker2.kendoMaskedTextBox({
          mask: "00:00"
        });

        datepicker2.kendoTimePicker({
          interval: 15,
          format: "HH:mm",
          parseFormats: ["HH:mm"]
        });

        datepicker2.closest(".k-datepicker")
        .add(datepicker2)
        .removeClass("k-textbox");
      });
    </script>
</body>

0
Dess | Tech Support Engineer, Principal
Telerik team
answered on 31 Jan 2017, 06:07 AM
Hello Ali,

Thank you for writing.  

I would like to note that this forum is related to the Telerik UI for WinForms suite. Please post your technical questions/replies in the relevant forum: http://www.telerik.com/forums

Thank you for your understanding.

Regards,
Dess
Telerik by Progress
Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Tags
MaskedEditBox
Asked by
Jaymie
Top achievements
Rank 1
Answers by
Deyan
Telerik team
Ali
Top achievements
Rank 1
Dess | Tech Support Engineer, Principal
Telerik team
Share this question
or