RadMaskedTextBox
RadMaskedTextBox is an enhanced data entry control that uses a mask to distinguish between proper and improper user input. It shares the common properties of all RadInput controls, including support for skins, styles for different states, empty message support, conditional postback on text change, flexible caret and button positioning, labels, and so on.
Definition
Namespace:Telerik.Web.UI
Assembly:Telerik.Web.UI.dll
Syntax:
[ClientScriptResource("Telerik.Web.UI.RadMaskedTextBox", "Telerik.Web.UI.Input.MaskedTextBox.RadMaskedInputScript.js")]
[RequiredScript(typeof(RadTextBox))]
[ToolboxBitmap(typeof(RadMaskedTextBox), "Toolbox.Icons.MaskedTextbox.png")]
[ValidationProperty("ValidationText")]
[ControlValueProperty("Text")]
[TelerikToolboxCategory("Data Editing")]
public class RadMaskedTextBox : RadInputControl, IComponent, IDisposable, IParserAccessor, IUrlResolutionService, IDataBindingsAccessor, IControlBuilderAccessor, IControlDesignerAccessor, IExpressionsAccessor, IAttributeAccessor, IScriptControl, IControlResolver, IPostBackDataHandler, ISkinnableControl, IControl, IPostBackEventHandler, INamingContainer, IEditableTextControl, ITextControl
Inheritance: objectControlWebControlRadWebControlRadInputControlRadMaskedTextBox...
Implements:
Inherited Members
Constructors
public RadMaskedTextBox()
Properties
Gets or sets a value which determines if empty mask parts are allowed.
[ClientControlProperty]
public bool AllowEmptyEnumerations { get; set; }
A value which determines if empty mask parts are allowed.
Gets or sets the number columns.
public virtual int Columns { get; set; }
The number columns.
Gets or sets the format position when the RadMaskedTextBox is in display mode.
[ClientControlProperty]
public DisplayFormatPosition DisplayFormatPosition { get; set; }
The format position when the RadMaskedTextBox is in display mode.
Gets or sets the display mask which is shown when the RadMaskedTextBox is not focused.
public string DisplayMask { get; set; }
The display mask which is shown when the RadMaskedTextBox is not focused.
Gets the MaskPartCollection which determines which mask parts will be used when the RadMaskedTextBox is not focused.
public MaskPartCollection DisplayMaskParts { get; }
The display mask parts.
Gets or sets the prompt character used in the display mask.
[ClientControlProperty]
public virtual string DisplayPromptChar { get; set; }
The prompt character used in the display mask.
Gets or sets if the prompt will be hidden when RadMaskedTextBox is blurred.
[ClientControlProperty]
public bool HideOnBlur { get; set; }
The hide on blur.
protected virtual MaskPartCollection InitialDisplayMasks { get; }
protected virtual string InitialHiddenFieldValue { get; }
protected virtual MaskPartCollection InitialMasks { get; }
Gets or sets the RadMaskedTextBox mask.
Gets the mask parts of a RadMaskedTextBox which determine which masks will be used for the control.
public MaskPartCollection MaskParts { get; }
The mask parts of a RadMaskedTextBox which determine which masks will be used for the control.
Gets or sets the maximum number of characters allowed in the text box.
[Browsable(false)]
public override int MaxLength { get; set; }
The maximum number of characters allowed in the text box. The default is 0, which indicates that the property is not set.
Overrides:
Use the MaxLength property to limit the number of characters that can be entered in the RadInput control. This property cannot be set by themes or style sheet themes. For more information, see ThemeableAttribute and Introduction to ASP.NET Themes.
Gets or sets alignment of numeric ranges.
public NumericRangeAlign NumericRangeAlign { get; set; }
The alignment of numeric ranges.
Gets or sets the prompt char.
[ClientControlProperty]
public virtual string PromptChar { get; set; }
The prompt char.
Gets or sets a value indicating whether the contents of the RadInput control can be changed.
[ClientControlProperty]
public override bool ReadOnly { get; set; }
true if the contents of the RadInput control cannot be changed; otherwise, false. The default value is false.
Overrides:
Use the ReadOnly property to specify whether the contents of the RadInput control can be changed. Setting this property to true will prevent users from entering a value or changing the existing value. Note that the user of the RadInput control cannot change this property; only the developer can. The Text value of a RadInput control with the ReadOnly property set to true is sent to the server when a postback occurs, but the server does no processing for a read-only RadInput. This prevents a malicious user from changing a Text value that is read-only. The value of the Text property is preserved in the view state between postbacks unless modified by server-side code. This property cannot be set by themes or style sheet themes.
Gets or sets if it is required to complete entered text in the RadMaskedTextBox. By default is 'false'. Set to 'true' if you want full text to be required.
public bool RequireCompleteText { get; set; }
Determines if it is required to complete entered text in the RadMaskedTextBox. By default is 'false'. Set to 'true' if you want full text to be required.
Gets or sets if the caret will be moved to the begging when the RadMaskedTextBox is focused.
[ClientControlProperty]
public bool ResetCaretOnFocus { get; set; }
Determines if the caret will be moved to the begging when the RadMaskedTextBox is focused.
Gets or sets if the numberic ranges will be rounded.
[ClientControlProperty]
public bool RoundNumericRanges { get; set; }
Determines if the numberic ranges will be rounded.
Gets or sets the number of rows.
public virtual int Rows { get; set; }
The number of rows.
Gets or sets the selection on focus options for the RadInput control
[ClientControlProperty]
[Themeable(true)]
public override SelectionOnFocus SelectionOnFocus { get; set; }
A Telerik.WebControls.SelectionOnFocus object that represents the selection on focus in RadInput control. The default value is "None".
- None
- CaretToBeginning
- CaretToEnd
- SelectAll
Overrides:
Use this property to provide selection on focus of RadInput control. You can set one of the following values:
Gets or sets the skin name for the control user interface.
public override string Skin { get; set; }
A string containing the skin name for the control user interface. The default is string.Empty.
Overrides:
If this property is not set, the control will render using the skin named "Default". If EnableEmbeddedSkins is set to false, the control will not render skin.
public virtual string SmartPasteDescription { get; set; }
protected override HtmlTextWriterTag TagKey { get; }
Overrides:
Gets or sets the text content of a control.
public override string Text { get; set; }
The text content of a control.
Overrides:
Gets or sets the text mode which could determine if the input will be multiline, password or normal single line input.
public InputMode TextMode { get; set; }
The text mode which could determine if the input will be multiline, password or normal single line input.
Gets or sets the text including literals.
[Browsable(true)]
public string TextWithLiterals { get; set; }
The text including literals.
Gets the text including the prompt.
[Browsable(true)]
public string TextWithPrompt { get; }
The text including the prompt.
Gets the text with prompt and literals.
[Browsable(true)]
public string TextWithPromptAndLiterals { get; }
The text with prompt and literals.
If the Wrap property is True, the value in the text box extends to the limit set by the Columns property, and then wraps to additional rows as necessary. If the Wrap property is False, the value in the text box does not wrap. Additional lines are used only if the text value includes a new-line character. A horizontal scroll bar appears if the value of any line exceeds the limit set by the Columns property.
public virtual bool Wrap { get; set; }
If the Wrap property is True, the value in the text box extends to the limit set by the Columns property, and then wraps to additional rows as necessary. If the Wrap property is False, the value in the text box does not wrap. Additional lines are used only if the text value includes a new-line character. A horizontal scroll bar appears if the value of any line exceeds the limit set by the Columns property.
Gets or sets if the values of numeric range parts of the mask to have a fixed width.
public bool ZeroPadNumericRanges { get; set; }
Enforces the values of numeric range parts of the mask to have a fixed width.
Methods
protected override void AddAttributesToRender(HtmlTextWriter writer)
Overrides:
protected override void DescribeClientEvents(IScriptDescriptor descriptor)
Overrides:
protected override void DescribeClientProperties(IScriptDescriptor descriptor)
Overrides:
protected override void DescribeComponent(IScriptDescriptor descriptor)
Overrides:
Loads the client state data
protected override void LoadClientState(Dictionary<string, object> clientState)
Overrides:
protected virtual void RefreshViewState()
protected override void RenderContentsSingleInputFields(HtmlTextWriter writer)
Overrides:
protected override void RenderTextAreaContents(HtmlTextWriter writer)
Overrides:
protected override void SetDefaultSize()
Overrides:
protected override void TrackViewState()
Overrides: