Skip to main content
Version: 4.1

DataGridViewMaskedTextBoxCell

Namespace: Wisej.Web

Assembly: Wisej.Framework (4.1.0.0)

Displays an editable MaskedTextBox control in a DataGridViewCell cell when in edit mode.

public class DataGridViewMaskedTextBoxCell : DataGridViewCell

Constructors​

Instance member DataGridViewMaskedTextBoxCell()​

Initializes a new instance of DataGridViewMaskedTextBoxCell.

Properties​

Instance member Culture​

CultureInfo: Returns or sets the culture information associated with the masked cell.

Value: A CultureInfo representing the culture supported by the MaskedTextBox.

Instance member EditType​

Type: Returns the type of the cell's editing control.

Value: A Type representing the DataGridViewMaskedTextBoxEditingControl type.

Instance member Mask​

String: Returns or sets the input mask. (Default: "")

Value: The current mask String. The default value is the empty string which allows any input.

The Mask is a string that defines the masking characters and the literals to display and process during user input and when reading the Value property.

Server side masking is processed by an instance of the MaskedTextProvider class exposed by the MaskedTextProvider property. On the client side, the mask processing is performed by the "wisej.utils.MaskProvider.js" class while the user edits the input field.

Masking CharacterDescription
0Digit, required. This element will accept any single digit between 0 and 9.
9Digit or space, optional.
#Digit or space, optional. If this position is blank in the mask, it will be rendered as a space in the Text property. Plus (+) and minus (-) signs are allowed.
LLetter, required. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z] in regular expressions.
?Letter, optional. Restricts input to the ASCII letters a-z and A-Z. This mask element is equivalent to [a-zA-Z]? in regular expressions.
&Character, required. This element behaves like the "L" element.
CCharacter, optional. Any non-control character. This element behaves like the "?" element.
AAlphanumeric, required. The only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "a" element.
aAlphanumeric, optional. The only characters it will accept are the ASCII letters a-z and A-Z. This mask element behaves like the "A" element.
.Decimal placeholder. The actual display character used will be the decimal symbol appropriate to the format provider, as determined by the control's FormatProvider property.
,Thousands placeholder. The actual display character used will be the thousands placeholder appropriate to the format provider, as determined by the control's FormatProvider property.
:Time separator. The actual display character used will be the time symbol appropriate to the format provider, as determined by the control's FormatProvider property.
/Date separator. The actual display character used will be the date symbol appropriate to the format provider, as determined by the control's FormatProvider property.
$Currency symbol. The actual character displayed will be the currency symbol appropriate to the format provider, as determined by the control's FormatProvider property.
<Shift down. Converts all characters that follow to lowercase.
>Shift up. Converts all characters that follow to uppercase.
|Disable a previous shift up or shift down.
\Escape. Escapes a mask character, turning it into a literal. "\" is the escape sequence for a backslash.
OthersLiterals. All non-mask elements will appear as themselves within MaskedTextBox. Literals always occupy a static position in the mask at run time, and cannot be moved or deleted by the user.

If you change the Mask when the control already contains a value, it will apply the new mask to the existing text.

The decimal (.), thousand (,), time (:), date (/), and currency ($) symbols default to displaying those symbols as defined by the application's culture. You can force a specific DataGridViewMaskedTextBoxCell them to display symbols for another culture by using the Culture property. Otherwise you can set the application-wide culture by setting the CurrentCulture property.

Instance member MaxInputLength​

Int32: Returns or sets the maximum number of characters that can be entered into the text box. (Default: 0)

Value: The maximum number of characters that can be entered into the text box; the default value is 0 (unlimited).

Throws:

Instance member PromptChar​

Char: Returns or sets the character used to represent the absence of user input in MaskedTextBox. (Default: _)

Value: The character used to prompt the user for input. The default is an underscore (_).

Throws:

Instance member TextMaskFormat​

MaskFormat: Returns or sets a value that determines whether literals and prompt characters are included in the formatted string. (Default: IncludeLiterals)

Value: One of the MaskFormat values. The default is IncludeLiterals.

Instance member Tools​

ComponentToolCollection: Returns the instance of ComponentToolCollection associated with this cell.

Instance member ValueType​

Type: Returns or sets the data type of the values in the cell.

Value: A Type representing the data type of the value in the cell.

Methods​

Instance member GetCellDataValue(cellStyle, includeVisualProperties)​

Returns the data value of the cell. This is the value that is returned to the client in the data response stream.

ParameterTypeDescription
cellStyle by referenceDataGridViewCellStyleThe cell style in effect for the current cell, used to format the cell's value for the client rendering.
includeVisualPropertiesBooleantrue to include inherited visual properties; otherwise, false to include only formatting properties.

Returns: Object.

Instance member InitializeEditingControl(editor, style)​

Initializes the control used to edit the cell.

ParameterTypeDescription
editorControlThe Control that is used to edit the cell.
styleDataGridViewCellStyleThe DataGridViewCellStyle that is in effect for the cell entering edit mode.

Throws:

Instance member ShouldUpdate()​

Indicates whether the cell data should be updated on the client even if the user didn't change the value when editing.

Returns: Boolean.

Implements​

NameDescription
IUserDataProvides access to the UserData and Tag properties associated to the component implementing this interface.
ICommandSourceDefines an object that can invoke a Command.