System.Windows.Forms.DataGridTextBoxColumn.Format Property

Gets or sets the character(s) that specify how text is formatted.

Syntax

[System.ComponentModel.DefaultValue(null)]
[System.ComponentModel.Editor("System.Windows.Forms.Design.DataGridColumnStyleFormatEditor, System.Design, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a", typeof(System.Drawing.Design.UITypeEditor))]
public string Format { set; get; }

Value

Documentation for this section has not yet been entered.

Remarks

The DataGridTextBoxColumn.Format property specifies how values are displayed in the column. For example, set the property to "c" to specify that the values will be formatted as the local currency. The System.Globalization.CultureInfo for the computer is used to determine the actual currency format. The values are automatically unformatted to the native type when data is changed.

For more information about formatting characters, see Formatting Types and Custom DateTime Format Strings.

The format you apply should be appropriate to the data type. For example, if the data is numeric in nature use one of the numeric format strings.

You can change the System.Globalization.CultureInfo for a System.Windows.Forms.DataGridTextBoxColumn by setting the DataGridTextBoxColumn.FormatInfo property to a new System.Globalization.CultureInfo instance constructed with an appropriate culture ID.

To set the System.Globalization.CultureInfo for the application, set the Application.CurrentCulture property of the System.Windows.Forms.Application object to a new System.Globalization.CultureInfo instance constructed with an appropriate culture ID.

Requirements

Namespace: System.Windows.Forms
Assembly: System.Windows.Forms (in System.Windows.Forms.dll)
Assembly Versions: 1.0.5000.0, 2.0.0.0