Skip to main content

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

DxTimeSpanMaskProperties.AllowNegativeValue Property

Specifies whether the editor’s value can be negative.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[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:

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

See Also