TimeEditProperties.EditFormatString Property
Gets or sets the pattern used to format the editor’s edited value displayed within the edit box.
Namespace: DevExpress.Web
Assembly: DevExpress.Web.v24.1.dll
NuGet Package: DevExpress.Web
Declaration
Property Value
Type | Default | Description |
---|---|---|
String | String.Empty | A string representing the format pattern. |
Remarks
Use the EditFormatString property to specify the format pattern that will be applied to the time editor’s edited value, displayed within the editor’s edit box. Typically, the EditFormatString property is used when the TimeEditProperties.EditFormat property is set to EditFormat.Custom.
Note
Display values can be formatted using the standard formatting mechanism. It allows you to format values using standard format patterns. Format specifiers for composing the format pattern are described in the Numeric Format Strings and Date and Time Format Strings topics.
Note
The EditFormatString property synchronizes its value with the editor’s ASPxTimeEdit.EditFormatString property.
Example
The example below demonstrates how you can customize the time section to allow end-users to specify time with seconds. For this purpose, the following properties are specified.
- The DateEditTimeSectionProperties.ShowSecondHand property is set to
true
to display the second hand on the clock. - The
TimeEditProperties.EditFormatString
property is set to “T” to format the time displayed within the time edit using the long time pattern. - The AppearanceStyle.Paddings property is specified (via ASPxDateEdit.TimeSectionProperties.TimeEditCellStyle.Paddings) to fit the time edit size to its inner content.
The image below shows the result.
<dx:ASPxDateEdit ID="ASPxDateEdit1" runat="server">
<TimeSectionProperties ShowSecondHand="True" Visible="True">
<TimeEditProperties EditFormatString="T">
</TimeEditProperties>
<TimeEditCellStyle>
<Paddings PaddingLeft="20px" PaddingRight="20px" />
</TimeEditCellStyle>
</TimeSectionProperties>
</dx:ASPxDateEdit>