Class RadMaskedEditBoxElement
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()
Constructor
Declaration
public RadMaskedEditBoxElement()
Remarks
There is no mask applied by default
Properties
AllowPromptAsInput
Declaration
public bool AllowPromptAsInput { get; set; }
Property Value
System.Boolean
|
ContextMenu
Represent the RadMaskedEditBox ContextMenu
Declaration
public RadContextMenu ContextMenu { get; set; }
Property Value
RadContextMenu
|
ContextMenuEnabled
Declaration
public bool ContextMenuEnabled { get; set; }
Property Value
System.Boolean
|
Culture
Gets 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. |
Exceptions
System.ArgumentNullException
This is thrown if the culture value is null |
EnableArrowKeys
Declaration
public bool EnableArrowKeys { get; set; }
Property Value
System.Boolean
|
EnableClickSelectionStart
Enables the SelectionStartMouseClick functionality.
Declaration
public bool EnableClickSelectionStart { get; set; }
Property Value
System.Boolean
|
EnableMouseWheel
Declaration
public bool EnableMouseWheel { get; set; }
Property Value
System.Boolean
|
EnableNullValueInput
Gets or set a value indicating whether end users can set the value to NULL. 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
This returns the result hint position for the last assignment to the Text property.
Declaration
public int HintPosition { get; }
Property Value
System.Int32
|
Remarks
If the assigned text could not be properly formatted, this will contain the position of the first failure.
IncludePrompt
This is used to set or get whether or not prompt characters are also displayed in the label text.
Declaration
public bool IncludePrompt { get; set; }
Property Value
System.Boolean
By default, prompt characters are not shown. |
IsKeyBoard
Declaration
public bool IsKeyBoard { get; }
Property Value
System.Boolean
|
Mask
This is used to set or get the mask for the label text
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 value for System.DateTime values of the provider.
Declaration
protected DateTime MaxDate { get; set; }
Property Value
System.DateTime
|
MaxTimeSpan
Gets or sets the maximum value for System.TimeSpan values when the provider is MaskTimeSpanProvider.
Declaration
protected TimeSpan MaxTimeSpan { get; set; }
Property Value
System.TimeSpan
|
MinDate
Gets or sets the minimum value for System.DateTime values of the provider.
Declaration
protected DateTime MinDate { get; set; }
Property Value
System.DateTime
|
MinTimeSpan
Gets or sets the minimum value for System.TimeSpan values when the provider is MaskTimeSpanProvider.
Declaration
protected TimeSpan MinTimeSpan { get; set; }
Property Value
System.TimeSpan
|
PromptChar
This is used to set or get the prompt character for display in the label text.
Declaration
public char PromptChar { get; set; }
Property Value
System.Char
The default is an underscore (_). |
Provider
ResultHint
This returns the result hint for the last assignment to the Text property.
Declaration
public MaskedTextResultHint ResultHint { get; }
Property Value
System.ComponentModel.MaskedTextResultHint
|
Remarks
If the assigned text could not be properly formatted, this will contain a hint as to why not. Positive values indicate success. Negative values indicate failure.
SelectionLengthOnMouseClick
The selection length will be set to this value when EnableClickSelectionStart is enabled.
Declaration
public int SelectionLengthOnMouseClick { get; set; }
Property Value
System.Int32
|
SelectionStartOnMouseClick
The selection start will be moved to this position when EnableClickSelectionStart is enabled.
Declaration
public int SelectionStartOnMouseClick { get; set; }
Property Value
System.Int32
|
Text
This is used to set or get the label text.
Declaration
public override string Text { get; set; }
Property Value
System.String
|
Overrides
Remarks
When set, the text is formatted according to the current masked text provider settings. If the mask is empty, the text is set as-is. When retrieved, the text is returned in its formatted state. Use UnmaskedText to get the text without the mask applied.
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. |
Exceptions
System.ComponentModel.InvalidEnumArgumentException
Property set with a System.Windows.Forms.MaskFormat value that is not valid. |
UnmaskedText
This read-only property returns the unmasked copy of the text
Declaration
public string UnmaskedText { get; }
Property Value
System.String
|
Value
Gets or sets the edited value
Declaration
public object Value { get; set; }
Property Value
System.Object
|
Methods
CallValueChanged(EventArgs)
Fires the ValueChanged event
Declaration
protected virtual void CallValueChanged(EventArgs e)
Parameters
System.EventArgs
e
|
CallValueChanging(CancelEventArgs)
Fires the ValueChanging event
Declaration
protected virtual void CallValueChanging(CancelEventArgs e)
Parameters
System.ComponentModel.CancelEventArgs
e
|
CreateMaskProvider()
Declaration
protected virtual void CreateMaskProvider()
DisposeManagedResources()
Declaration
protected override void DisposeManagedResources()
Overrides
Down()
Declaration
public void Down()
ExcludeLiterals()
Declaration
protected virtual string ExcludeLiterals()
Returns
System.String
|
ExcludePrompt()
Declaration
protected virtual string ExcludePrompt()
Returns
System.String
|
ExcludePromptAndLiterals()
Declaration
protected virtual string ExcludePromptAndLiterals()
Returns
System.String
|
Format(String, String)
Format the specified text using the specified mask
Declaration
public static string Format(string mask, string text)
Parameters
System.String
mask
The mask to use |
System.String
text
The text to format |
Returns
System.String
The formatted text string |
Format(String, String, Char)
Format 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. |
System.String
text
The text to format. |
System.Char
promptChar
The prompt character to use for missing characters. If a null character ('\x0') is specified, prompt characters are omitted. |
Returns
System.String
The formatted text string. |
Format(String, String, Char, CultureInfo)
Format 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. |
System.String
text
The text to format. |
System.Char
promptChar
The prompt character to use for missing characters. If a null character ('\x0') is specified, prompt characters are omitted. |
System.Globalization.CultureInfo
culture
The culture information to use. If null, the current culture is used. |
Returns
System.String
The formatted text string. |
Format(String, String, Char, CultureInfo, out MaskedTextResultHint, out Int32)
Format the specified text using the specified mask, prompt character, and culture information and return the result values.
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. |
System.String
text
The text to format. |
System.Char
promptChar
The prompt character to use for missing characters. If a null character ('\x0') is specified, prompt characters are omitted. |
System.Globalization.CultureInfo
culture
The culture information to use. If null, the current culture is used. |
System.ComponentModel.MaskedTextResultHint
hint
The result of formatting the text. |
System.Int32
hintPosition
The position related to the result hint. |
Returns
System.String
The formatted text string. |
GetClipboardText()
Gets the text which is in the clipboard
Declaration
public static string GetClipboardText()
Returns
System.String
|
GetFormat(String, CultureInfo)
Declaration
public static NumericCharacterTextBoxProvider.RadNumericMaskFormatType GetFormat(string formatString, CultureInfo culture)
Parameters
System.String
formatString
|
System.Globalization.CultureInfo
culture
|
Returns
NumericCharacterTextBoxProvider.RadNumericMaskFormatType
|
HandleKeyPress(KeyPressEventArgs)
handles the key press
Declaration
public virtual void HandleKeyPress(KeyPressEventArgs e)
Parameters
System.Windows.Forms.KeyPressEventArgs
e
|
OnClearButtonClick()
Declaration
protected override void OnClearButtonClick()
Overrides
OnMaskProviderCreated()
Declaration
protected virtual void OnMaskProviderCreated()
OnMouseDown(MouseEventArgs)
Declaration
protected override void OnMouseDown(MouseEventArgs e)
Parameters
System.Windows.Forms.MouseEventArgs
e
|
Overrides
RemoveNumberFormats(String)
Declaration
public string RemoveNumberFormats(string value)
Parameters
System.String
value
|
Returns
System.String
|
SetCultureCore(CultureInfo)
Declaration
protected virtual void SetCultureCore(CultureInfo value)
Parameters
System.Globalization.CultureInfo
value
|
TextBoxItem_MouseWheel(Object, MouseEventArgs)
Declaration
protected virtual void TextBoxItem_MouseWheel(object sender, MouseEventArgs e)
Parameters
System.Object
sender
|
System.Windows.Forms.MouseEventArgs
e
|
Up()
Declaration
public void Up()
Validate(String)
Declaration
public virtual void Validate(string value)
Parameters
System.String
value
|
Events
MaskProviderCreated
Occurs when MaskProvider has been created This event will be fired multiple times because the provider is created when some properties changed Properties are: Mask, Culture, MaskType and more.
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.
Declaration
public event CancelEventHandler ValueChanging
Event Type
System.ComponentModel.CancelEventHandler
|