Version

GetText Method

Returns the text for the object using the specified mask mode
Syntax
'Declaration
 
Public Function GetText( _
   ByVal maskMode As Infragistics.Win.UltraWinMaskedEdit.MaskMode _
) As String
public string GetText( 
   Infragistics.Win.UltraWinMaskedEdit.MaskMode maskMode
)

Parameters

maskMode
The mask mode which will be used to determine the text returned.

Return Value

The text for the object using the specified mask mode
Remarks

There may be times when you need to work with the text of an object in a particular format, but do not wish to change the settings of any of the masking properties (MaskClipMode, MaskDataMode or MaskDisplayMode). For example, if you want to retrieve the text of an object with all literals and prompt characters intact, but don't want to change the way data will be sent to the the database and don't want to use the clipboard. This is the purpose of the GetText method.

GetText returns a string value, containing the text of the object, in the format you specify. When you invoke the GetText method, you pass it a maskmode parameter that determines how the object's text will be returned. This gives you the ability to bypass the settings of the object's masking properties and determine on an ad hoc basis whether to use prompt characters, literals or just the raw text the user has entered.

Example
Following code illustrates UltraGridCell.GetText method and different mask modes.

Imports Infragistics.Shared
Imports Infragistics.Win
Imports Infragistics.Win.UltraWinGrid
Imports System.Diagnostics

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

       ' Enable masked input in a column by setting the MaskInput property.
       Dim column As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(0).Columns("Phone")
       column.MaskInput = "(###) ###-####"

       ' Set the MaskDataMode to Raw.
       column.MaskDataMode = MaskMode.Raw

       ' Get a cell in the coumn to demonstrate the mask modes.
       Dim cell As UltraGridCell = Me.UltraGrid1.Rows(0).Cells(column)

       ' Assing a cell value that partially fills the specified mask.
       cell.Value = "123"

       Debug.WriteLine("Cell.Text = " & cell.Text)
       Debug.WriteLine("Cell.GetText( MaskMode.Raw ) = " & cell.GetText(MaskMode.Raw))
       Debug.WriteLine("Cell.GetText( MaskMode.IncludeLiterals ) = " & cell.GetText(MaskMode.IncludeLiterals))
       Debug.WriteLine("Cell.GetText( MaskMode.IncludeLiteralsWithPadding ) = " & cell.GetText(MaskMode.IncludeLiteralsWithPadding))
       Debug.WriteLine("Cell.GetText( MaskMode.IncludeLiteralsWithPadding ) = " & cell.GetText(MaskMode.IncludePromptChars))
       Debug.WriteLine("Cell.GetText( MaskMode.IncludeBoth ) = " & cell.GetText(MaskMode.IncludeBoth))

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

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

	// Enable masked input in a column by setting the MaskInput property.
	UltraGridColumn column = this.ultraGrid1.DisplayLayout.Bands[0].Columns["Phone"];
	column.MaskInput = "(###) ###-####";

	// Set the MaskDataMode to Raw.
	column.MaskDataMode    = MaskMode.Raw;

	// Get a cell in the coumn to demonstrate the mask modes.
	UltraGridCell cell = this.ultraGrid1.Rows[0].Cells[column];

	// Assing a cell value that partially fills the specified mask.
	cell.Value = "123";

	Debug.WriteLine( "Cell.Text = " + cell.Text );
	Debug.WriteLine( "Cell.GetText( MaskMode.Raw ) = " + cell.GetText( MaskMode.Raw ) );
	Debug.WriteLine( "Cell.GetText( MaskMode.IncludeLiterals ) = " + cell.GetText( MaskMode.IncludeLiterals ) );
	Debug.WriteLine( "Cell.GetText( MaskMode.IncludeLiteralsWithPadding ) = " + cell.GetText( MaskMode.IncludeLiteralsWithPadding ) );
	Debug.WriteLine( "Cell.GetText( MaskMode.IncludeLiteralsWithPadding ) = " + cell.GetText( MaskMode.IncludePromptChars ) );
	Debug.WriteLine( "Cell.GetText( MaskMode.IncludeBoth ) = " + cell.GetText( MaskMode.IncludeBoth ) );

}
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