IDataGridColumn.ValueFormat

Fore Syntax

ValueFormat: String;

Fore.NET Syntax

ValueFormat: String;

Description

The ValueFormat property determines the table data display format.

Comments

This property is platform localization independent, this means, that 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 section Number Format.

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 regional settings a point must be set 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 digits. The Format variable is to store the following common template for a number not considering the regional parameters: 0,00. The LocalFormat variable is to store (considering the regional parameters) the following template for a number: 0.00.

See also:

IDataGridColumn