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

DxTextMaskProperties.SaveLiteral Property

Specifies whether an editor’s value contains constantly-displayed mask characters (literals).

Namespace: DevExpress.Blazor

Assembly: DevExpress.Blazor.v24.2.dll

NuGet Package: DevExpress.Blazor

#Declaration

C#
[DefaultValue(true)]
[Parameter]
public bool SaveLiteral { get; set; }

#Property Value

Type Default Description
Boolean true

true to include literals in an editor’s value; otherwise, false.

#Remarks

Literal characters are arbitrary read-only characters in the Masked Input’s edit box. If you add a character that is not a meta or special character to a Text mask expression, the character is displayed in the edit box as is. To display a meta or special character as a literal, precede it with a backslash.

A user has no need to enter literal characters (the cursor skips over them).

Razor
<DxMaskedInput @bind-Value="Value" 
               Mask="@(@"\A>LL-00")" >
</DxMaskedInput>

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

Text Masks - Empty Alpha-Numeric Sequence

Literals are saved to the Masked Input’s Value. To change this default behavior and not save literals to the editor’s value, set the SaveLiteral property to false.

Razor
<DxMaskedInput @bind-Value="Value"
               Mask="(000) 000-0000">
    <DxTextMaskProperties SaveLiteral="false" />
</DxMaskedInput>

@code{
    String Value { get; set; }
}
See Also