IDataGridColumn.ValueFormat

Syntax

ValueFormat: String;

Description

The ValueFormat property determines the table data display format.

Comments

This property is platform localization independent, that is, when determining the property value the commas and spaces are used as separators in a template.

A data format is generated using reserved format codes. Codes are described in the Number Format section.

This property value is affected by the LocalValueFormat property: when the user determines the LocalValueFormat property value, this value is then converted to a common form (ignoring regional parameters) and is inserted into the ValueFormat property. Also, on getting the LocalValueFormat property value, this property returns the ValueFormat property value converted to a localized form according to regional settings.

Example

Executing the example requires a form with the Button1 button and the DataGrid component named DataGrid1. In the regional settings set a point as a decimal separator.

    Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
    Var
        Column: IDataGridColumn;
        Format, LocalFormat: String;
    Begin
        Column := DataGrid1.Columns.Item(0);
        Column.ValueFormat := "0,00";
        Format := Column.ValueFormat;
        LocalFormat := Column.LocalValueFormat;
    End Sub Button1OnClick;

After executing the example the following format is set for the first column: number with two decimal places. The Format variable will store the following common template for a number not considering the regional parameters: 0,00. The LocalFormat variable will store (considering the regional parameters) the following template for a number: 0.00.

See also:

IDataGridColumn