ComponentOne True DBGrid Pro 8
Specifying an input mask for a column

The EditMask property of the Column object is used to specify an input mask template for end-user data entry. You can construct your own input mask string using template characters similar to those recognized by the Visual Basic Format$ function. The input mask string is composed of special characters that represent either an input character that the user must enter, or a literal character that will be skipped over on input. Valid template characters are as follows:

#                                  Digit placeholder

@                                  Character placeholder

>                                  All characters following will be in uppercase

<                                  All characters following will be in lowercase

~                                  Turns off the previous "<" or ">"

?                                   Digit or character

\                                   Next character is treated as a literal

&                                  Any character

Any other character will be treated as a literal. For example, to specify a phone number template, you could use:

Example Title
Copy Code
TDBGrid1.Columns("Phone").EditMask = "(###) ###-####"

In this example, the parentheses, space, and hyphen are all literals, while the pound signs signify digit placeholders.

After the user finishes editing a cell with this input mask, True DBGrid caches the modified cell text, but any literal characters in the input mask template will be stripped from the modified cell text beforehand. In the preceding example, only the 10 digits denoted by the # placeholders will be cached; the punctuation marks and the space will be omitted.

 

 


Copyright (c) GrapeCity, inc. All rights reserved.

Product Support Forum  |  Documentation Feedback