Skip to main content
A newer version of this page is available. .
All docs
V20.2

TimeSpanMaskOptions.HideInsignificantPartsOnly Attached Property

Specifies whether the editor displays optional empty parts that may affect the value readability. This is an attached property.

Namespace: DevExpress.Xpf.Editors

Assembly: DevExpress.Xpf.Core.v20.2.dll

NuGet Packages: DevExpress.WindowsDesktop.Wpf.Core, DevExpress.Wpf.Core

Declaration

Returns

Type Default Description
Boolean true

true to hide only insignificant optional empty parts (parts that do not affect the value readability);

false to hide all optional empty parts.

Remarks

A mask expression can include optional parts (for example, dd[:hh][:mm][:ss] contains 3 optional parts). The HideInsignificantPartsOnly property specifies which optional empty parts the editor hides (only insignificant or all).

Example 1: Mask without Specifiers

HideInsignificantPartsOnly = “True”

<dxe:TextEdit Mask="dd[:hh][:mm][:ss]" EditValue="-5.00:02:00" MaskUseAsDisplayFormat="True" 
              MaskType="TimeSpan" dxe:TimeSpanMaskOptions.HideInsignificantPartsOnly="True"/>

The TextEdit hides the “seconds” part because it is zero and insignificant (does not affect the readability).

HideInsignificantPartsOnly = “False”

<dxe:TextEdit Mask="dd[:hh][:mm][:ss]" EditValue="-5.00:02:00" MaskUseAsDisplayFormat="True" 
              MaskType="TimeSpan" dxe:TimeSpanMaskOptions.HideInsignificantPartsOnly="False"/>

If you set the HideInsignificantPartsOnly property to false, the editor hides all optional zero parts. In the example, the TextEdit hides the “seconds” and “hours” parts. As a result, the value for the dd[:hh][:mm][:ss] mask expression is short but unclear (does not allow you to recognize the entered value).

Example 2: Mask with Specifiers

HideInsignificantPartsOnly = “True”

<dxe:TextEdit Mask="dd DD [hh HH ][mm MM ][ss SS]" EditValue="-5.00:02:00" MaskUseAsDisplayFormat="True" 
              MaskType="TimeSpan" dxe:TimeSpanMaskOptions.HideInsignificantPartsOnly="True"/>

The TextEdit hides the “seconds” part because it is zero and insignificant (does not affect the readability).

HideInsignificantPartsOnly = “False”

<dxe:TextEdit Mask="dd DD [hh HH ][mm MM ][ss SS]" EditValue="-5.00:02:00" MaskUseAsDisplayFormat="True" 
              MaskType="TimeSpan" dxe:TimeSpanMaskOptions.HideInsignificantPartsOnly="False"/>

If you set the HideInsignificantPartsOnly property to false, the editor hides all optional zero parts. In the example, the TextEdit hides the “seconds” and “hours” parts. As a result, the value for the dd DD [hh HH ][mm MM ][ss SS] mask expression is short and clear (allows you to recognize the entered value because the mask contains specifiers like D, H, M, and S).

See Also