Skip to main content
All docs
V24.2

DevExpress v24.2 Update — Your Feedback Matters

Our What's New in v24.2 webpage includes product-specific surveys. Your response to our survey questions will help us measure product satisfaction for features released in this major update and help us refine our plans for our next major release.

Take the survey Not interested

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.v24.2.dll

NuGet Package: 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