Skip to main content

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.

public class TimePicker : ej2Base

Constructors​

Instance member 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);

Instance member TimePicker(options)​

Constructs a new instance of the TimePicker class.

NameTypeDescription
optionsObjectInitial 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​

Instance member 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";

Implements​