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 determined in the current regional settings.
Changing the value of the LocalValueFormat property results in changing the value of the IDataGridColumn.ValueFormat property. When the user determines a value of the LocalValueFormat property, this value is converted to a common form (ignoring the regional settings) and is inserted to the IDataGridColumn.ValueFormat property. When getting value of the LocalValueFormat property, the property returns value of the IDataGridColumn.ValueFormat property converted to localized format.
Executing the example requires a form, a button named Button1 positioned on it and the DataGrid component named DataGrid1. In the regional settings set a point as a decimal separator.
Sub Button1OnClick(Sender: Object; Args: IMouseEventArgs);
Var
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: