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

DxSpinEditSettings.Mask Property

Specifies a mask pattern.

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(null)]
[Parameter]
public string Mask { get; set; }

#Property Value

Type Default Description
String null

The mask pattern.

#Remarks

An input mask is used when a string entered by a user should comply with a specific format.

To define an input mask, assign a mask pattern to the Mask property. You can use predefined mask patterns, standard numeric .NET formats, or custom numeric format strings 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 more information on available mask patterns, refer to the following topic: Numeric Masks.

In the following code snippet, the Mask property value forces the editor to display the currency character in edit mode.

razor
<DxGrid Data="@products" ShowFilterRow="true" PageSize="4"
        EditMode="GridEditMode.EditRow">
    <Columns>
        <DxGridCommandColumn />
        <DxGridDataColumn FieldName="ProductID" Width="140px" />
        <DxGridDataColumn FieldName="ProductName" />
        <DxGridDataColumn FieldName="UnitPrice" Width="140px" DisplayFormat="c" >
            <EditSettings>
                <DxSpinEditSettings Mask="@NumericMask.Currency" />
            </EditSettings>
        </DxGridDataColumn>
        <DxGridDataColumn FieldName="UnitsInOrder"  Width="140px" />
    </Columns>
</DxGrid>

Input Mask

Use the MaskProperties property to additionally configure mask settings: specify the current culture and validation message.

To change the input mask at runtime, use the ISpinEditSettings.Mask property instead.

#Implements

See Also