Back to Devexpress

DxSpinEdit<T>.Mask Property

blazor-devexpress-dot-blazor-dot-dxspinedit-1-3ffa783c.md

latest2.4 KB
Original Source

DxSpinEdit<T>.Mask Property

Specifies a mask pattern.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
[Parameter]
public string Mask { get; set; }

Property Value

TypeDescription
String

A mask pattern string.

|

Remarks

Use the Mask property to set up a Spin 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 numeric .NET formats to specify the mask. Note that display values depend on the current culture. For example, the same input mask may define different settings for the U.S. and Germany ( currency symbol, thousand separator, precision, and so on). For additional information on available mask patterns, refer to the following topic: Numeric Masks.

razor
<DxSpinEdit @bind-Value="Value"
            Mask="#,##0.00" />

@code{
    Double Value { get; set; }
}

Configure Mask Properties

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

The following code snippet enables the French culture.

razor
@using System.Globalization

<DxSpinEdit @bind-Value="Value"
            Mask="@NumericMask.Currency">
    <DxNumericMaskProperties Culture="Culture" />
</DxSpinEdit>

@code{
    Double Value { get; set; }
    CultureInfo Culture = CultureInfo.GetCultureInfo("fr-FR");
}

See Also

DxSpinEdit<T> Class

DxSpinEdit<T> Members

DevExpress.Blazor Namespace