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

DxTimeEdit<T>.Mask Property

Specifies a mask pattern.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[Parameter]
public string Mask { get; set; }

#Property Value

Type Description
String

A mask pattern string.

#Remarks

Use the Mask property to set up a Time Edit‘s mask pattern in code.

#Apply a Mask

To set up a mask, assign a desired mask pattern to the Mask property. You can use predefined mask patterns or standard date and time .NET formats to specify the mask. Note that display values depend on the current culture. For more information on available mask patterns, refer to the following topic: Date and Time Mask Types.

Razor
<DxTimeEdit @bind-Time="Value"
            Mask="hh:mm" />

@code{
    DateTime Value { get; set; } = DateTime.Now;
}

Time Edit - Mask

#Configure Mask Properties

If required, configure mask settings (the current culture, caret mode, and so on). For this purpose, add the DxDateTimeMaskProperties component to the Date Edit markup and specify the component’s properties.

The following code snippet enables the Advancing caret mode.

Razor
<DxTimeEdit @bind-Time="Value"
                Mask="hh:mm">
        <DxDateTimeMaskProperties CaretMode="MaskCaretMode.Advancing" />
</DxTimeEdit>

@code{
    DateTime Value { get; set; } = DateTime.Now;
}
See Also