Skip to main content

DxTimeSpanMaskProperties.HideAllZeroValueOptionalSections Property

Specifies whether a time span mask hides all zero value optional sections.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

[DefaultValue(false)]
[Parameter]
public bool HideAllZeroValueOptionalSections { get; set; }

Property Value

Type Default Description
Boolean false

true to hide all zero value optional sections; false to hide an optional zero value section only if it is the first or last visible section.

Remarks

Enclose mask sections in square brackets to mark them as optional. The editor hides an optional zero value section if it is the first or last visible section. Set the HideAllZeroValueOptionalSections property to true to hide all zero value optional sections:

<DxMaskedInput @bind-Value="@time" 
               Mask="[dd DD ]hh HH[ mm MM][ ss SS][nnn NN]">
    <DxTimeSpanMaskProperties HideAllZeroValueOptionalSections=true />
</DxMaskedInput>

@code {
    TimeSpan time { get; set; } = new TimeSpan(5, 16, 0, 15, 0);
}

Hide All Zero Value Optional Sections

This setting can affect the editor’s value readability. In the following code snippet, the editor hides the minutes section. As a result, the editor value is short but unclear.

<DxMaskedInput @bind-Value="@time" 
               Mask="[dd.]hh[:mm][:ss][:fff]">
    <DxTimeSpanMaskProperties HideAllZeroValueOptionalSections=true />
</DxMaskedInput>

@code {
    TimeSpan time { get; set; } = new TimeSpan(5, 16, 0, 15, 0);
}

Hide All Zero Values Optional Section Can Affect Readability

Refer to the following topic for more information: Mask Settings.

See Also