Gets or sets the custom Format Provider that will be used to format
the data in the column's cells.
Property Value
A reference to a class that implements the
System.IFormatProvider interface.
The first example modifies the
System.Globalization.DateTimeFormatInfo.DateSeparator property of an instance of a
System.Globalization.DateTimeFormatInfo object and then assigns the DateTimeFormatInfo object to the FormatProvider property. The second example, modifies the DateTimeFormatInfo object in the same manner but also specifies the format of the column to display the contents of the cell in "short date" format:
' FormatProvider
Dim dtfi As New System.Globalization.DateTimeFormatInfo dtfi()
dtfi.DateSeparator ="/"
grid.Columns( "Date1" ).FormatProvider = dtfi
' FormatProvider AND FormatSpecifier
grid.Columns( "Date2" ).FormatProvider = dtfi
grid.Columns( "Date2" ).FormatSpecifier = "d"
// FormatProvider
System.Globalization.DateTimeFormatInfo dtfi = new System.Globalization.DateTimeFormatInfo();
dtfi.DateSeparator = "/";
grid.Columns[ "Date1" ].FormatProvider = dtfi;
// FormatProvider AND FormatSpecifier
grid.Columns[ "Date2" ].FormatProvider = dtfi;
grid.Columns[ "Date2" ].FormatSpecifier = "d";
Target Platforms: 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