Version

Format Property

Returns or sets a string used to control the formatting of displayed text.
Syntax
'Declaration
 
Public Property Format As String
public string Format {get; set;}
Remarks

The Format property is similar to the Visual Basic Format function, and supports all of the named arguments and literal strings supported by that function when the UltraGrid is being used in Visual Basic. In other host environments, the Format property provides a subset of the Format function's capabilites, including the use of named arguments.

The Format property applies only to cells that are not in edit mode.

The underlying .NET formatting mechanism is used to format the value. See .NET help for more information regarding list of the named formats that are supported.

Example
Following code sets the Format and FormatInfo formatting properties on two columns.

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

  Private Sub Button96_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles button96.Click

      Dim dateColumn As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(1).Columns("OrderDate")
      Dim currencyColumn As UltraGridColumn = Me.UltraGrid1.DisplayLayout.Bands(2).Columns("Unit Price")

      ' Set the Format and FormatInfo properties. You don't have to set both. You can set one
      ' or the other or both.
      currencyColumn.Format = "##,###,####.00"
      currencyColumn.FormatInfo = System.Globalization.CultureInfo.CreateSpecificCulture("fr")

      dateColumn.Format = "dd/M/yyyy"
      dateColumn.FormatInfo = System.Globalization.CultureInfo.CreateSpecificCulture("fr")

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

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

	UltraGridColumn dateColumn = this.ultraGrid1.DisplayLayout.Bands[1].Columns["OrderDate"];
	UltraGridColumn currencyColumn = this.ultraGrid1.DisplayLayout.Bands[2].Columns["Unit Price"];

	// Set the Format and FormatInfo properties. You don't have to set both. You can set one
	// or the other or both.
	currencyColumn.Format = "##,###,####.00";
	currencyColumn.FormatInfo = System.Globalization.CultureInfo.CreateSpecificCulture( "fr" );

	dateColumn.Format = "dd/M/yyyy";
	dateColumn.FormatInfo = System.Globalization.CultureInfo.CreateSpecificCulture( "fr" );

}
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