Back to Devexpress

How to: Format Values in the Vertical Grid Using Standard Format Strings

windowsforms-2160-controls-and-libraries-vertical-grid-examples-how-to-format-values-in-the-vertical-grid-using-standard-format-strings.md

latest1.2 KB
Original Source

How to: Format Values in the Vertical Grid Using Standard Format Strings

  • Nov 13, 2018

The following example demonstrates how to format values in the VerticalGrid’s rows using standard format strings. These are described in the Format Specifiers topic.

Values in the rowPrice row will be formatted as a currency amount. Values in the rowDeliveryDate row will be represented in the Long Date form.

The image below shows the result.

csharp
using DevExpress.Utils;
// ...
rowPrice.Properties.Format.FormatType = FormatType.Numeric;
rowPrice.Properties.Format.FormatString = "c2";
rowDeliveryDate.Properties.Format.FormatType = FormatType.DateTime;
rowDeliveryDate.Properties.Format.FormatString = "D";
vb
Imports DevExpress.Utils
' ...
rowPrice.Properties.Format.FormatType = FormatType.Numeric
rowPrice.Properties.Format.FormatString = "c2"
rowDeliveryDate.Properties.Format.FormatType = FormatType.DateTime
rowDeliveryDate.Properties.Format.FormatString = "D"