TimePicker
Namespace: Wisej.Web.Ext.Syncfusion2
Assembly: Wisej.Web.Ext.Syncfusion2 (4.1.0.0)
Time picker is a simple and intuitive interface component that allows selection of a time value from the popup list or setting a desired time value.
- C#
- VB.NET
public class TimePicker : ej2Base
Public Class TimePicker
Inherits ej2Base
Constructors
TimePicker()
Constructs a new instance of the TimePicker class.
Example:
The following example creates a time picker and configures it through the Options object.
var timePicker = new TimePicker();
timePicker.Options.placeholder = "Select a time";
timePicker.Options.step = 15;
this.Controls.Add(timePicker);
TimePicker(options)
Constructs a new instance of the TimePicker class.
| Name | Type | Description |
|---|---|---|
| options | Object | Initial set of options. |
Example:
The following example creates a time picker that uses the 24-hour format and lists the office hours in steps of 30 minutes.
var timePicker = new TimePicker(new
{
placeholder = "Start time",
format = "HH:mm",
step = 30,
min = DateTime.Today.AddHours(8),
max = DateTime.Today.AddHours(18)
});
this.Controls.Add(timePicker);
Properties
Text
String: Returns or sets the value of the TimePicker as a string. (Default: "")
The property reads and writes the value option of the widget. The text assigned to the property is passed to the widget as the new value and should match the format option. Setting the property always fires the TextChanged event.
The property can be used only when the value option is not set or is a string: a value assigned as a DateTime must be read and changed through Options.
The property is not updated when the user selects a time in the browser. To receive the time selected by the user, handle the change event of the widget.
Example:
var timePicker = new TimePicker(new { format = "HH:mm" });
this.Controls.Add(timePicker);
// set the time using the format of the picker.
timePicker.Text = "14:30";