Skip to main content

DxTimeSpanMaskProperties.AllowNegativeValue Property

Specifies whether the editor’s value can be negative.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.1.dll

NuGet Package: DevExpress.Blazor

Declaration

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

Property Value

Type Default Description
Boolean true

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:

<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 more information: Mask Settings.

See Also