How to: Add Custom Text to a Formatted String
The following example demonstrates a way to format numeric values and insert custom display text within the output formatted string.
Assume that a text editor displays numeric identifiers. An identifier should be represented as a four digit field (preceding zeros might be added if necessary); in addition, the “ID:” string needs to be displayed before the formatted identifier. To format values, use the editor’s RepositoryItem.DisplayFormat property. The FormatInfo.FormatType property is set to FormatType.Numeric and the FormatInfo.FormatString property is set to an appropriate format pattern.
For an editor whose BaseEdit.EditValue property is set to 5, the display text will be as follows:
Note
To enable formatted input within editors, use Masks.