Masks

The VSFlexGrid control supports masked editing, where an input mask is used to automatically validate the input as the user types. This is done through the ColEditMask property, which takes a string that defines what characters are valid for each input position. Masks may be used with regular text fields and with drop-down combo fields.

Mask strings have two types of characters: literal characters, which become part of the input, and template characters, which serve as placeholders for characters belonging to specific categories (for example, digits or alphabetic). For example, you could use a mask like "(999) 999-9999" for entering phone numbers (the digit "9" is a placeholder that stands for any digit). For details on the syntax used to build the mask strings, see the EditMask property in the control reference section.

If different cells in the same column need different masks, trap the BeforeEdit event and set the EditMask property to an appropriate value for the current cell.