Version

MaskDisplayMode Property

Returns or sets a value that determines cell values will be displayed when the cells are not in edit mode and data masking is enabled.
Syntax
'Declaration
 
Public Property MaskDisplayMode As Infragistics.Win.UltraWinMaskedEdit.MaskMode
public Infragistics.Win.UltraWinMaskedEdit.MaskMode MaskDisplayMode {get; set;}
Remarks

This property is used to determine how mask literals and prompt characters are displayed when a cell is not in edit mode. Based on the setting of this property, the text in the clipboard will contain no prompt characters or literals (just the raw data), the data and just the literals, the data and just the prompt characters, or all the text including both prompt characters and literals. The formatted spacing of partially masked values can be preserved by indicating to include literals with padding, which includes data and literal characters, but replaces prompt characters with spaces.

Generally, prompt characters disappear when a cell is no longer in edit mode, as a visual cue to the user. In some cases, however, it may be appropriate in your application to display mask literals as well as data when a cell is no longer in edit mode.

The MaskInput property is used to specify how data input will be masked for the cells in a column. The mask usually includes literal characters that are used to delimit the data entered by the user. This property has no effect unless the MaskInput property is set, meaning that data masking is enabled. You should also note that masking can only be applied to single-line cells. If a cell is displaying ultiple lines of text, no masking will be applied to the cell.

When data masking is enabled, the MaskClipMode property determines how cell values are copied to the clipboard, the MaskDataMode property indicates how cell values are stored by the data source, and the PromptChar property specifies which character will be used to prompt the user to input data.

Example
Following code shows how to use masked input functionality in the UltraGrid. It sets various mask related proeprties.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid

  Private Sub Button17_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button17.Click

      Dim column As UltraGridColumn = Me.ultraGrid1.DisplayLayout.Bands(0).Columns("Phone")

      ' Enable masked input in a column by setting the MaskInput property.
      column.MaskInput = "(###) ###-####"

      ' Set various mask modes. These mask modes effect how what is included when data
      ' is committed to the cell, when it's displayed and when it's copied. MaskMode of
      ' Raw does not include literals and prompt characters. So for this particular mask,
      ' only thig that is going to be put in the data source will be just the digits, 
      ' Literals will be stripped out (in this example, literals are '(', ')', ' ', '-' 
      ' characters.)
      column.MaskDataMode = MaskMode.Raw
      column.MaskDisplayMode = MaskMode.IncludeBoth
      column.MaskClipMode = MaskMode.IncludeLiterals

      ' PadChar and PromptChar properties effect which characters are used as pad character
      ' and prompt character in masked input cells. Padchar is the character that gets 
      ' substituted in place of an empty character when the MaskMode of 
      ' IncludeLiteralsWithPadding is applied. PromptChar is the character that's used
      ' for prompting. Default for PadChar is ' ' (space character) and for PromptChar is
      ' '_' (an underscore).
      Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0).PadChar = " "
      Me.ultraGrid1.DisplayLayout.Bands(0).Columns(0).PromptChar = "_"

  End Sub
using Infragistics.Shared;
using Infragistics.Win;
using Infragistics.Win.UltraWinGrid;
using System.Diagnostics;

private void button17_Click(object sender, System.EventArgs e)
{

	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns["Phone"];

	// Enable masked input in a column by setting the MaskInput property.
	column.MaskInput = "(###) ###-####";

	// Set various mask modes. These mask modes effect how what is included when data
	// is committed to the cell, when it's displayed and when it's copied. MaskMode of
	// Raw does not include literals and prompt characters. So for this particular mask,
	// only thig that is going to be put in the data source will be just the digits, 
	// Literals will be stripped out (in this example, literals are '(', ')', ' ', '-' 
	// characters.)
	column.MaskDataMode    = MaskMode.Raw;
	column.MaskDisplayMode = MaskMode.IncludeBoth;
	column.MaskClipMode    = MaskMode.IncludeLiterals;

	// PadChar and PromptChar properties effect which characters are used as pad character
	// and prompt character in masked input cells. Padchar is the character that gets 
	// substituted in place of an empty character when the MaskMode of 
	// IncludeLiteralsWithPadding is applied. PromptChar is the character that's used
	// for prompting. Default for PadChar is ' ' (space character) and for PromptChar is
	// '_' (an underscore).
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].PadChar = ' ';
	this.ultraGrid1.DisplayLayout.Bands[0].Columns[0].PromptChar = '_';

}
Requirements

Target Platforms: Windows 10, Windows 8.1, Windows 8, Windows 7, Windows Server 2012, Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also