Since it is common for the input and display formats to be the same, the NumberFormat property has an Edit Mask option (note the space between words). If this option is selected, then the EditMask property setting will be used for both data input and display. However, the input and display formats need not be the same, so you are free to select a NumberFormat option that differs from the EditMask property.
For example, the following code applies a phone number template to a column for both display and editing:
Me.C1TrueDBGrid1.Columns("Phone").EditMask = "(###) ###-####"
Me.C1TrueDBGrid1.Columns("Phone").NumberFormat = "Edit Mask"
· C#
this.c1TrueDBGrid1.Columns("Phone").EditMask = "(###) ###-####";
this.c1TrueDBGrid1.Columns("Phone").NumberFormat = "Edit Mask";
· Delphi
Self.C1TrueDBGrid1.Columns['Phone'].EditMask := '(###) ###-####';
Self.C1TrueDBGrid1.Columns['Phone'].NumberFormat := 'Edit Mask';
For more information on how to specify a data input mask, see Input Masking.
Send comments about this topic to ComponentOne. Copyright © ComponentOne LLC. All rights reserved. |