Back to Devexpress

DxTimeSpanMaskProperties.HideAllZeroValueOptionalSections Property

blazor-devexpress-dot-blazor-dot-dxtimespanmaskproperties-bd051810.md

latest2.4 KB
Original Source

DxTimeSpanMaskProperties.HideAllZeroValueOptionalSections Property

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

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

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

Property Value

TypeDefaultDescription
Booleanfalse

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:

razor
<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);
}

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.

razor
<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);
}

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

See Also

DxTimeSpanMaskProperties Class

DxTimeSpanMaskProperties Members

DevExpress.Blazor Namespace