Back to Devexpress

RepositoryItemTimeSpanEdit Class

windowsforms-devexpress-dot-xtraeditors-dot-repository-ca8cb8fe.md

latest6.1 KB
Original Source

RepositoryItemTimeSpanEdit Class

Represents a repository item that stores settings specific to the TimeSpanEdit control.

Namespace : DevExpress.XtraEditors.Repository

Assembly : DevExpress.XtraEditors.v25.2.dll

NuGet Package : DevExpress.Win.Navigation

Declaration

csharp
public class RepositoryItemTimeSpanEdit :
    RepositoryItemTimeEdit
vb
Public Class RepositoryItemTimeSpanEdit
    Inherits RepositoryItemTimeEdit

The following members return RepositoryItemTimeSpanEdit objects:

Remarks

A RepositoryItemTimeSpanEdit object represents a repository item that stores a TimeSpanEdit control’s settings. You can use the repository item to assign the editor to a column in a data-aware control, to display the editor in a ribbon, etc. For a stand-alone editor, use the TimeSpanEdit.Properties property to access these settings.

Edit Style

The TimeEditStyle property specifies how users modify the time span:

  • SpinButtons — spin buttons that are placed vertically one under another.

  • TouchUI — a touch drop-down panel with tiles.

Note

The TimeSpanEdit control always uses spin buttons if a time-span input mask is applied (the TimeSpanEdit.Properties.Mask.MaskType property is set to TimeSpan or TimeSpanAdvancingCaret).

Input Restrictions

The editor allows users to edit days, hours, minutes, seconds, and milliseconds in the edit box or drop-down menu.

Value format depends on the current culture settings (see LongTimePattern). Use the MaskSettings or EditMask property to customize the input mask. The editor supports mask specifiers for days (‘d’), hours (‘h’), minutes (‘m’), seconds (‘s’), and second fractions (‘f’). Drop-down menu sections correspond to the specified mask (if the input mask contains only days, the drop-down menu allows the user to change only days).

Note

The mask expression should be compatible with the TimeSpan format.

csharp
timeSpanEdit1.Properties.EditMask = "dd.hh.mm";
//Or
//using DevExpress.XtraEditors.Mask;
//var mask = timeSpanEdit1.Properties.MaskSettings.Configure<MaskSettings.TimeSpan>();
//mask.MaskExpression = "dd.hh.mm";
vb
timeSpanEdit1.Properties.EditMask = "dd.hh.mm"
'Or
'using DevExpress.XtraEditors.Mask;
'var mask = timeSpanEdit1.Properties.MaskSettings.Configure<MaskSettings.TimeSpan>();
'mask.MaskExpression = "dd.hh.mm";

You can use MinValue and MaxValue properties to specify the range of possible values. The drop-down menu does not display values outside the range.

csharp
timeSpanEdit1.Properties.MinValue = new TimeSpan(0, 1, 0, 0);
timeSpanEdit1.Properties.MaxValue = new TimeSpan(2, 2, 5, 59);
vb
timeSpanEdit1.Properties.MinValue = New TimeSpan(0, 1, 0, 0)
timeSpanEdit1.Properties.MaxValue = New TimeSpan(2, 2, 5, 59)

Inheritance

Show 11 items

Object MarshalByRefObject Component DevExpress.XtraEditors.ComponentBase RepositoryItem RepositoryItemTextEdit RepositoryItemButtonEdit RepositoryItemPopupBase RepositoryItemBaseSpinEdit RepositoryItemTimeEdit RepositoryItemTimeSpanEdit

See Also

RepositoryItemTimeSpanEdit Members

Properties

DevExpress.XtraEditors.Repository Namespace