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

Clear Button in TimePicker's TimeView Popup

1 Answer 62 Views
TimePicker
This is a migrated thread and some comments may be shown as answers.
Michael Malone
Top achievements
Rank 1
Michael Malone asked on 09 Jul 2015, 05:12 PM

I need a way to clear values from a TimePicker. Users are not able to manually interact with the textbox, they can only use the pop up values from the TimeView to select preset values in 15 minute increments. In the link below the first example has a "Clear button" at the bottom of the TimeView. Unfortunately I don't see a code example. How do I get a clear button like the example? 

 

http://docs.telerik.com/devtools/aspnet-ajax/controls/calendar/raddatepicker,-radtimepicker,-raddatetimepicker-and-radmonthyearpicker/configuring-the-embedded-time-view

1 Answer, 1 is accepted

Sort by
0
Eyup
Telerik team
answered on 14 Jul 2015, 12:11 PM
Hi Michael,

You can achieve this requirement using a FooterTemplate:
http://docs.telerik.com/devtools/aspnet-ajax/controls/calendar/templates/radtimeview-templates

For your convenience, I have prepared a sample for your case:
<telerik:RadTimePicker ID="RadTimePicker1" runat="server">
    <TimeView runat="server">
        <FooterTemplate>
            <asp:Button ID="Button1" runat="server" Text="Clear" OnClientClick="clearClick(); return false;" />
        </FooterTemplate>
    </TimeView>
</telerik:RadTimePicker>
JavaScript:
function clearClick() {
    var picker = $find('<%= RadTimePicker1.ClientID %>');
    picker.clear();
}

Hope this helps. Please give it a try and let me know about the result.

Regards,
Eyup
Telerik
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 Feedback Portal and vote to affect the priority of the items
Tags
TimePicker
Asked by
Michael Malone
Top achievements
Rank 1
Answers by
Eyup
Telerik team
Share this question
or