LocalValueFormat: String;
The LocalValueFormat property determines the data display format in a table column according to regional parameters settings.
A data format is generated using reserved format codes. Codes are described in the Number Format section. When specifying the format use the separators that are determined by the current regional settings.
Changing the value of the LocalValueFormat property results in changing the value of the ValueFormat property. When the user determines the LocalValueFormat property value, this value is converted to a common form (ignoring the regional settings) and is inserted into the ValueFormat property. When getting the LocalValueFormat property value, the ValueFormat property value converted to localized format is returned.
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);
Format, LocalFormat: String;
Begin
Column := DataGrid1.Columns.Item(0);
Column.LocalValueFormat := "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: