This example demonstrates how to create a TimePicker control based on the ASPxDropDownEdit control.
Follow the steps below to create a time picker:
- Put the ASPxDropDownEdit control to your web form or into a UserControl.
- Handle the control's
Initevent to specify the DropDownWindowTemplate. This template should implement the ITemplate interface. In this class, populate the control's popup window content with controls. - In your custom template class, call the InstantiateIn method to create buttons that are used for time picking. Set their AutoPostBack properties to
falseto prevent them from sending postbacks while clicking. Handle a button's client-sideClickevent to set theASPxDropDownEditcontrol text value on the client side on a button click. You can also use this event to close DropDownWindow.
- TimePickerDropDownTemplate.cs (VB: TimePickerDropDownTemplate.vb)
- Default.aspx (VB: Default.aspx)
- Default.aspx.cs (VB: Default.aspx.vb)
- TimePicker.ascx (VB: TimePicker.ascx)
- TimePicker.ascx.cs (VB: TimePicker.ascx.vb)
(you will be redirected to DevExpress.com to submit your response)