Back to Devexpress

DxTimeSpanMaskProperties.AllowNegativeValue Property

blazor-devexpress-dot-blazor-dot-dxtimespanmaskproperties-a1d7d507.md

latest1.7 KB
Original Source

DxTimeSpanMaskProperties.AllowNegativeValue Property

Specifies whether the editor’s value can be negative.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[DefaultValue(true)]
[Parameter]
public bool AllowNegativeValue { get; set; }

Property Value

TypeDefaultDescription
Booleantrue

true if the editor’s value can be negative; otherwise, false.

|

Remarks

Time span masks allow users to enter a negative time interval. Set this property to false to prevent users from entering a negative value:

razor
<DxMaskedInput @bind-Value="@time" 
               Mask="@TimeSpanMask.GeneralShortFormat">
    <DxTimeSpanMaskProperties AllowNegativeValue="false" />
</DxMaskedInput>

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

Note

You can assign a negative value to the editor even if this property is set to false. In this case, the editor converts this value to a positive value only after a user modifies it. Until that time, the editor value remains negative.

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

See Also

DxTimeSpanMaskProperties Class

DxTimeSpanMaskProperties Members

DevExpress.Blazor Namespace