Placeholder

The Placeholder character is a character used to represent the absence of user input in a RadMaskedInput control. The default value is an underscore. The Placeholder character will be displayed in a RadMaskedInput control for any mask position that the user has not filled in yet.

Example 1: Using the default placeholder

<telerik:RadMaskedTextInput Mask="####" /> 

Figure 1 : Default placeholder

Silverlight RadMaskedInput Default Placeholder

When the Value of a RadMaskedInput control contains underscore character, it will be removed when we use the default placeholder. This is because of the default placeholder of the control is underscore character "_". You can alter this behavior by changing the default Placeholder or setting the ValueMode property to IncludeLiteralsAndPlaceholders or IncludePlaceholders. Example 1 demonstrates how to change the default Placeholder of the control.

Example 1: Change the default placeholder

<telerik:RadMaskedTextInput Mask="####" Placeholder="$" /> 

Figure 2: Custom placeholder

Silverlight RadMaskedInput Custom placeholder

You can set a watermark content to the RadMaskedInput controls by using the EmptyContent and EmptyContentTemplate properties. When the Value of a RadMaskedInput control is null or empty the EmptyContent will be displayed. For more information, read Watermark.

See Also

In this article