DataGridMaskedStringColumn Class
Represents a base class for data-bound columns for use in a DataGrid that utilize MaskedTextBox controls.
public class DataGridMaskedStringColumn : DataGridBoundColumnBase
- Inheritance:
- object DataGridColumn DataGridBoundColumn DataGridBoundColumnBase object
Constructors
DataGridMaskedStringColumn()
Initializes an instance of the class.
public DataGridMaskedStringColumn()
Properties
DefaultEditingElementStyle
Gets the default value for the EditingElementStyleProperty dependency property.
public static Style DefaultEditingElementStyle { get; }
Property Value
- Style:
The default value for the
EditingElementStylePropertydependency property.
DefaultElementStyle
Gets the default value for the EditingElementStyleProperty dependency property.
public static Style DefaultElementStyle { get; }
Property Value
- Style:
The default value for the
EditingElementStylePropertydependency property.
IsCaseAutoCorrected
Gets or sets whether characters entered will have their case auto-corrected to match the defined mask.
public bool IsCaseAutoCorrected { get; set; }
Property Value
- bool:
trueif characters entered will have their case auto-corrected to match the defined mask; otherwise,false. The default value isfalse.
Remarks
When this property is set to true, then the IsCaseSensitive property is ignored.
IsCaseSensitive
Gets or sets whether the mask is case sensitive.
public bool IsCaseSensitive { get; set; }
Property Value
- bool:
trueif the mask is case sensitive; otherwise,false. The default value isfalse.
Remarks
When the IsCaseAutoCorrected property is set to true, this property is ignored.
Mask
Gets or sets the text that designates the input mask.
public string Mask { get; set; }
Property Value
- string:
The text that designates the input mask. The default value is
null.
MaskKind
Gets or sets the kind of input mask.
public MaskKind MaskKind { get; set; }
Property Value
- MaskKind:
The kind of input mask. The default value is
Regex.
PromptChar
Gets or sets the character used to indicate required input.
public char PromptChar { get; set; }
Property Value
- char:
The character used to indicate required input. The default value is
\u2022.
PromptVisibility
Gets or sets the visibility of mask prompts.
public MaskPromptVisibility PromptVisibility { get; set; }
Property Value
- MaskPromptVisibility:
A MaskPromptVisibility that indicates the visibility of mask prompts. The default value is
FocusedOnly.
Methods
ApplyStandardValues(FrameworkElement)
Applies standard values to the specified target element.
protected virtual void ApplyStandardValues(FrameworkElement targetElement)
| Parameter | Type | Description |
|---|---|---|
| targetElement | FrameworkElement | The target element. |
CommitCellEdit(FrameworkElement)
Commits the cell edit.
protected override bool CommitCellEdit(FrameworkElement editingElement)
| Parameter | Type | Description |
|---|---|---|
| editingElement | FrameworkElement | The editing element. |
Returns
GenerateEditingElement(DataGridCell, object)
Generates the editing element.
protected override FrameworkElement GenerateEditingElement(DataGridCell cell, object dataItem)
| Parameter | Type | Description |
|---|---|---|
| cell | DataGridCell | The cell. |
| dataItem | object | The data item. |
Returns
- FrameworkElement:
The
FrameworkElementto use for editing.
GenerateElement(DataGridCell, object)
Generates the display element.
protected override FrameworkElement GenerateElement(DataGridCell cell, object dataItem)
| Parameter | Type | Description |
|---|---|---|
| cell | DataGridCell | The cell. |
| dataItem | object | The data item. |
Returns
- FrameworkElement:
The
FrameworkElementto use for display.
GenerateMaskedTextBox(bool, DataGridCell)
Generates an instance of a MaskedTextBox object.
protected virtual MaskedTextBox GenerateMaskedTextBox(bool isEditing, DataGridCell cell)
| Parameter | Type | Description |
|---|---|---|
| isEditing | bool | Whether the text box will be used for editing. |
| cell | DataGridCell | The cell. |
Returns
- MaskedTextBox:
An instance of a
MaskedTextBoxobject.
PrepareCellForEdit(FrameworkElement, RoutedEventArgs)
Prepares the cell for edit.
protected override object PrepareCellForEdit(FrameworkElement editingElement, RoutedEventArgs editingEventArgs)
| Parameter | Type | Description |
|---|---|---|
| editingElement | FrameworkElement | The editing element. |
| editingEventArgs | RoutedEventArgs | The RoutedEventArgs instance containing the event data. |
Returns
Fields
IsCaseAutoCorrectedProperty
Identifies the IsCaseAutoCorrected dependency property. This field is read-only.
public static readonly DependencyProperty IsCaseAutoCorrectedProperty
IsCaseSensitiveProperty
Identifies the IsCaseSensitive dependency property. This field is read-only.
public static readonly DependencyProperty IsCaseSensitiveProperty
MaskKindProperty
Identifies the MaskKind dependency property. This field is read-only.
public static readonly DependencyProperty MaskKindProperty
MaskProperty
Identifies the Mask dependency property. This field is read-only.
public static readonly DependencyProperty MaskProperty
PromptCharProperty
Identifies the PromptChar dependency property. This field is read-only.
public static readonly DependencyProperty PromptCharProperty
PromptVisibilityProperty
Identifies the PromptVisibility dependency property. This field is read-only.
public static readonly DependencyProperty PromptVisibilityProperty