Gets or sets the string that specifies the display format for items in the column.

Namespace:  C1.Web.UI.Controls.C1GridView
Assembly:  C1.Web.UI.Controls.2 (in C1.Web.UI.Controls.2.dll)

Syntax

C#
[DefaultValueAttribute("")]
[JsonAttribute(true, true, "")]
[TypeConverterAttribute("C1.Web.UI.Design.C1GridViewFormatConverter, C1.Web.UI.Design.2")]
public virtual string DataFormatString { get; set; }
Visual Basic
<DefaultValueAttribute("")> _
<JsonAttribute(True, True, "")> _
<TypeConverterAttribute("C1.Web.UI.Design.C1GridViewFormatConverter, C1.Web.UI.Design.2")> _
Public Overridable Property DataFormatString As String
	Get
	Set

Field Value

This property is used to provide a custom format for the items in the column.

Remarks

The data format string consists of two parts, separated by a colon, in the form {A:Bxx}. For example, the formatting string, {0:D2}, would format the cell to display a number with two decimal places.

Note: The entire string must be enclosed in curly braces to denote that it is a format string and not a literal string. Any text outside the curly braces is displayed as literal text.

The value before the colon (A in the general example) specifies the parameter index in a zero-based list of parameters.

Note: This value can only be set to 0 because there is only one value in each cell.

The character after the colon (B in the general example) specifies the format to display the value in. The following table lists the common formats.

  • C - Displays numeric values in currency format.
  • D - Displays numeric values in decimal format.
  • E - Displays numeric values in scientific (exponential) format.
  • F - Displays numeric values in fixed format.
  • G - Displays numeric values in general format.
  • N - Displays numeric values in number format.
  • X - Displays numeric values in hexadecimal format.

Note: The format character is not case-sensitive, except for X, which displays the hexadecimal characters in the case specified.

The value after the format character (xx in the general example) specifies the number of significant digits or decimal places to display the value in.

See Also