DataGridViewCellStyle::Format Property

 

Gets or sets the format string applied to the textual content of a DataGridView cell.

Namespace:   System.Windows.Forms
Assembly:  System.Windows.Forms (in System.Windows.Forms.dll)

public:
property String^ Format {
	String^ get();
	void set(String^ value);
}

Property Value

Type: System::String^

A string that indicates the format of the cell value. The default is Empty.

The Format property specifies how cell values are formatted as strings. For more information, see Formatting Types in the .NET Framework.

The following code example sets the format of dates in the column named Last Fixed to "Month, year" by setting the Format property on the column's DefaultCellStyle property. This code example is part of a larger example provided for the DataGridViewCellStyle class.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: