PropertyEditor.EditMask Property
Specifies a mask expression for a Property Editor’s control.
Namespace: DevExpress.ExpressApp.Editors
Assembly: DevExpress.ExpressApp.v21.2.dll
NuGet Package: DevExpress.ExpressApp
Declaration
Property Value
Type | Description |
---|---|
String | A mask expression for a Property Editor’s control. |
Remarks
Note
Use the EditMask property to specify a mask expression in ASP.NET Web Forms and ASP.NET Core Blazor applications. In WinForms applications, utilize MaskSettings instead.
Set the EditMask property if a user input should follow a specific format or pattern. For example, if a field accepts phone numbers, you can set the editor’s mask to (000) 000-0000
.
The mask expression syntax depends on the mask type. For more information on available mask types and their syntaxes, see the following section: Mask Types.
You can set the EditMask property in the Application Model. In the Model Editor, locate the View Item node that corresponds to the Property Editor. In that node, set the EditMask property value.
You can also set the EditMask property in Controller code:
public partial class ViewController1 : ViewController<DetailView> {
// ...
protected override void OnActivated() {
base.OnActivated();
var editor = View.FindItem("ZipPostal") as ASPxStringPropertyEditor;
editor.EditMask = "#####";
}
// ...
}
For more information on how to access editors in code, see the following topic: Access Editor Settings.
If you create a custom Property Editor that should support the EditMask property, implement your logic to apply the EditMask property value to your custom editor.
Note
The EditMask property does not prohibit users from saving an incorrect value to a database (for example, when they do not fill all the required digits in a phone number). Configure Validation settings to prevent data errors.