Gets or sets the edit mask for a column.
[Visual Basic]
Public Property EditMask As String
[C#]
public string EditMask {get;set;}
[Delphi]
public property EditMask: String read get_EditMask write set_EditMask;
Remarks
The EditMask property allows an input mask to be specified for automatic input formatting and validation. The mask syntax is similar to the one used by Microsoft Access. Setting the input mask for a column will prevent the user from entering any information in the cell that is not in the format of the EditMask string.
The EditMask must be a string composed of the following symbols:
Wildcards
0 |
Digit. |
9 |
Digit or space. |
# |
Digit or sign. |
L |
Letter. |
? |
Letter or space. |
A |
Letter or digit. |
a |
Letter, digit or space. |
& |
Any character. |
Localized characters
. |
Localized decimal separator. |
, |
Localized thousand separator. |
: |
Localized time separator. |
/ |
Localized date separator. |
Command characters
\ |
Next character is taken as a literal. |
> |
Translate letters to uppercase. |
< |
Translate letters to lowercase. |
Example
The following code sets the EditMask property so the user can enter a phone number with optional area code, and a state in captials:
' Set the mask so the user can enter a phone number, with optional area code, and a state in capitals.
Me.C1TrueDBGrid.Columns(0).EditMask = "(###) 000-0000 St\ate\: >LL"
· C#
// Set the mask so the user can enter a phone number, with optional area code, and a state in capitals.
this.c1TrueDBGrid.Columns[0].EditMask = "(###) 000-0000 St\ate\: >LL";
· Delphi
// Set the mask so the user can enter a phone number, with optional area code, and a state in capitals.
Self.C1TrueDBGrid.Columns[0].EditMask := '(###) 000-0000 St\ate\: >LL';
See Also
C1DataColumn Class | C1DataColumn Members | C1.Win.C1TrueDBGrid Namespace
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |