Class RadMaskedEditBoxElement
Represents a RadMaskedEditBoxElement class that provides text input with validation and formatting through various mask types including numeric, date/time, standard character masks, email validation, and IP address input.
Inheritance
Inherited Members
Namespace: Telerik.WinControls.UI
Assembly: Telerik.WinControls.UI.dll
Syntax
public class RadMaskedEditBoxElement : RadTextBoxElement, INotifyPropertyChanged, ICustomTypeDescriptor, ISupportSystemSkin, IComponent, IDisposable, IBindableComponent, ISupportDrag, ISupportDrop, IShortcutProvider, IStylableElement, IStylableNode
Constructors
RadMaskedEditBoxElement()
Initializes a new instance of the RadMaskedEditBoxElement class with no mask applied by default.
Declaration
public RadMaskedEditBoxElement()
Properties
AllowPromptAsInput
Gets or sets a value indicating whether prompt characters are allowed as valid input by the user.
Declaration
public bool AllowPromptAsInput { get; set; }
Property Value
System.Boolean
|
ContextMenu
Gets or sets the context menu for the RadMaskedEditBoxElement class.
Declaration
public RadContextMenu ContextMenu { get; set; }
Property Value
RadContextMenu
|
ContextMenuEnabled
This property is not relevant for this class.
Declaration
public bool ContextMenuEnabled { get; set; }
Property Value
System.Boolean
|
Culture
Gets or sets the culture that determines the value of the localizable separators and placeholders in the input mask.
Declaration
public CultureInfo Culture { get; set; }
Property Value
System.Globalization.CultureInfo
A System.Globalization.CultureInfo containing the culture information associated with the input mask. |
EnableArrowKeys
This property is not relevant for this class.
Declaration
public bool EnableArrowKeys { get; set; }
Property Value
System.Boolean
|
EnableClickSelectionStart
Gets or sets a value indicating whether the selection functionality on mouse click is enabled.
Declaration
public bool EnableClickSelectionStart { get; set; }
Property Value
System.Boolean
|
EnableMouseWheel
This property is not relevant for this class.
Declaration
public bool EnableMouseWheel { get; set; }
Property Value
System.Boolean
|
EnableNullValueInput
Gets or sets a value indicating whether end users can set the value to null using keyboard combinations. This can be achieved by pressing Ctrl + Del or Ctrl + 0 key combinations.
Declaration
public virtual bool EnableNullValueInput { get; set; }
Property Value
System.Boolean
|
HintPosition
Gets the result hint position for the last assignment to the Text property.
Declaration
public int HintPosition { get; }
Property Value
System.Int32
|
IncludePrompt
Gets or sets a value indicating whether prompt characters are displayed in the formatted output.
Declaration
public bool IncludePrompt { get; set; }
Property Value
System.Boolean
|
IsKeyBoard
This property is not relevant for this class.
Declaration
public bool IsKeyBoard { get; }
Property Value
System.Boolean
|
Mask
Gets or sets the input mask to use for validating user input.
Declaration
public string Mask { get; set; }
Property Value
System.String
|
MaskType
Gets or sets the mask type.
Declaration
public virtual MaskType MaskType { get; set; }
Property Value
MaskType
|
MaxDate
Gets or sets the maximum date value for System.DateTime providers.
Declaration
protected DateTime MaxDate { get; set; }
Property Value
System.DateTime
|
MaxTimeSpan
Gets or sets the maximum value for System.TimeSpan providers.
Declaration
protected TimeSpan MaxTimeSpan { get; set; }
Property Value
System.TimeSpan
|
MinDate
Gets or sets the minimum date value for System.DateTime providers.
Declaration
protected DateTime MinDate { get; set; }
Property Value
System.DateTime
|
MinTimeSpan
Gets or sets the minimum value for System.TimeSpan providers.
Declaration
protected TimeSpan MinTimeSpan { get; set; }
Property Value
System.TimeSpan
|
PromptChar
Gets or sets the prompt character used to represent missing input positions in the mask.
Declaration
public char PromptChar { get; set; }
Property Value
System.Char
|
Provider
This property is not relevant for this class.
Declaration
public IMaskProvider Provider { get; set; }
Property Value
IMaskProvider
|
ResultHint
Gets the result hint for the last assignment to the Text property.
Declaration
public MaskedTextResultHint ResultHint { get; }
Property Value
System.ComponentModel.MaskedTextResultHint
|
SelectionLengthOnMouseClick
Gets or sets the selection length that will be applied when EnableClickSelectionStart is enabled and a mouse click occurs.
Declaration
public int SelectionLengthOnMouseClick { get; set; }
Property Value
System.Int32
|
SelectionStartOnMouseClick
Gets or sets the selection start position that will be applied when EnableClickSelectionStart is enabled and a mouse click occurs.
Declaration
public int SelectionStartOnMouseClick { get; set; }
Property Value
System.Int32
|
Text
Gets or sets the text displayed in the control.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
TextMaskFormat
Gets or sets a value that determines whether literals and prompt characters are included in the formatted string.
Declaration
public MaskFormat TextMaskFormat { get; set; }
Property Value
System.Windows.Forms.MaskFormat
One of the System.Windows.Forms.MaskFormat values. The default is System.Windows.Forms.MaskFormat.IncludePromptAndLiterals. |
UnmaskedText
Gets the unmasked copy of the text without formatting characters.
Declaration
public string UnmaskedText { get; }
Property Value
System.String
|
Value
Gets or sets the value of the RadMaskedEditBoxElement class.
Declaration
public object Value { get; set; }
Property Value
System.Object
|
Methods
CallValueChanged(EventArgs)
Raises the ValueChanged event when the value has been modified.
Declaration
protected virtual void CallValueChanged(EventArgs e)
Parameters
System.EventArgs
e
The event arguments |
CallValueChanging(CancelEventArgs)
Raises the ValueChanging event when the value is about to be modified, allowing cancellation.
Declaration
protected virtual void CallValueChanging(CancelEventArgs e)
Parameters
System.ComponentModel.CancelEventArgs
e
The cancel event arguments |
CreateMaskProvider()
Creates and configures the appropriate mask provider based on the current mask type, culture, and mask settings.
Declaration
protected virtual void CreateMaskProvider()
DisposeManagedResources()
Disposes of the managed resources used by the masked edit box element.
Declaration
protected override void DisposeManagedResources()
Overrides
Down()
Decrements the value at the current cursor position based on the mask type.
Declaration
public void Down()
ExcludeLiterals()
Returns the text value with literal characters excluded but prompt characters included.
Declaration
protected virtual string ExcludeLiterals()
Returns
System.String
The text value without literal characters |
ExcludePrompt()
Returns the text value with prompt characters excluded but literal characters included.
Declaration
protected virtual string ExcludePrompt()
Returns
System.String
The text value without prompt characters |
ExcludePromptAndLiterals()
Returns the text value with both prompt characters and literal characters excluded.
Declaration
protected virtual string ExcludePromptAndLiterals()
Returns
System.String
The text value without prompt and literal characters |
Format(String, String)
Formats the specified text using the specified mask.
Declaration
public static string Format(string mask, string text)
Parameters
System.String
mask
The mask to use for formatting |
System.String
text
The text to format |
Returns
System.String
The formatted text string |
Format(String, String, Char)
Formats the specified text using the specified mask and prompt character.
Declaration
public static string Format(string mask, string text, char promptChar)
Parameters
System.String
mask
The mask to use for formatting |
System.String
text
The text to format |
System.Char
promptChar
The prompt character to use for missing characters |
Returns
System.String
The formatted text string |
Format(String, String, Char, CultureInfo)
Formats the specified text using the specified mask, prompt character, and culture information.
Declaration
public static string Format(string mask, string text, char promptChar, CultureInfo culture)
Parameters
System.String
mask
The mask to use for formatting |
System.String
text
The text to format |
System.Char
promptChar
The prompt character to use for missing characters |
System.Globalization.CultureInfo
culture
The culture information to use for formatting |
Returns
System.String
The formatted text string |
Format(String, String, Char, CultureInfo, out MaskedTextResultHint, out Int32)
Formats the specified text using the specified mask, prompt character, and culture information, returning detailed result information.
Declaration
public static string Format(string mask, string text, char promptChar, CultureInfo culture, out MaskedTextResultHint hint, out int hintPosition)
Parameters
System.String
mask
The mask to use for formatting |
System.String
text
The text to format |
System.Char
promptChar
The prompt character to use for missing characters |
System.Globalization.CultureInfo
culture
The culture information to use for formatting |
System.ComponentModel.MaskedTextResultHint
hint
Returns the result of the formatting operation |
System.Int32
hintPosition
Returns the position related to the result hint |
Returns
System.String
The formatted text string |
GetClipboardText()
Retrieves text content from the system clipboard, supporting both Unicode and standard text formats.
Declaration
public static string GetClipboardText()
Returns
System.String
The clipboard text content, or an empty string if no text is available |
GetFormat(String, CultureInfo)
Determines the numeric format type based on a format string and culture.
Declaration
public static NumericCharacterTextBoxProvider.RadNumericMaskFormatType GetFormat(string formatString, CultureInfo culture)
Parameters
System.String
formatString
The format string to analyze |
System.Globalization.CultureInfo
culture
The culture information |
Returns
NumericCharacterTextBoxProvider.RadNumericMaskFormatType
The corresponding numeric format type |
HandleKeyPress(KeyPressEventArgs)
Handles key press events for clipboard operations and other special key combinations.
Declaration
public virtual void HandleKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
The key press event arguments |
OnClearButtonClick()
Handles the clear button click event by setting the value to null if null value input is enabled, or validating an empty string otherwise.
Declaration
protected override void OnClearButtonClick()
Overrides
OnMaskProviderCreated()
Raises the MaskProviderCreated event when a new mask provider has been created.
Declaration
protected virtual void OnMaskProviderCreated()
OnMouseDown(MouseEventArgs)
Handles mouse down events to set selection position and length when click selection start is enabled.
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments |
Overrides
RemoveNumberFormats(String)
Removes number formatting characters and symbols based on the current culture and numeric provider type.
Declaration
public string RemoveNumberFormats(string value)
Parameters
System.String
value
The value to process |
Returns
System.String
The value with number formatting removed |
SetCultureCore(CultureInfo)
Sets the culture for the masked edit box and recreates the mask provider with the new culture settings.
Declaration
protected virtual void SetCultureCore(CultureInfo value)
Parameters
System.Globalization.CultureInfo
value
The new culture to apply |
TextBoxItem_MouseWheel(Object, MouseEventArgs)
Handles mouse wheel events to increment or decrement values when mouse wheel is enabled and the control is not read-only.
Declaration
protected virtual void TextBoxItem_MouseWheel(object sender, MouseEventArgs e)
Parameters
System.Object
sender
The event source |
System.Windows.Forms.MouseEventArgs
e
The mouse event arguments |
Up()
Increments the value at the current cursor position based on the mask type.
Declaration
public void Up()
Validate(String)
Validates the specified value against the current mask and updates the display.
Declaration
public virtual void Validate(string value)
Parameters
System.String
value
The value to validate |
Events
MaskProviderCreated
Occurs when the mask provider has been created. This event fires multiple times because the provider is recreated when properties like Mask, Culture, or MaskType change.
Declaration
public event EventHandler MaskProviderCreated
Event Type
System.EventHandler
|
ValueChanged
Occurs when the editing value has been changed.
Declaration
public event EventHandler ValueChanged
Event Type
System.EventHandler
|
ValueChanging
Occurs when the editing value is changing and allows cancellation of the change.
Declaration
public event CancelEventHandler ValueChanging
Event Type
System.ComponentModel.CancelEventHandler
|