Description: Calculates the width of each DBGrid data column during grid setup.
Arguments:
Argument_Col: zero-based column index supplied by the current platform.
Argument_EntryName: entry assigned to the column.
Argument_ColWidth: width calculated before the formula runs, in pixels.
Result: Return an integer width in pixels. Returning Argument_ColWidth preserves the proposed width for columns that require no override.
Desktop behavior: A valid formula is evaluated for each visible entry column during initialization and disables user-controlled horizontal column resizing.
Web behavior: The formula participates in automatic column sizing but does not disable later user resizing. A previously stored positive user width takes precedence and can cause the formula to be skipped for that column.
Other variables: Common DBGrid variables are not assigned consistently on all execution paths. Scripts should depend only on the three event arguments listed above.
Availability: DBForm DBGrid component on desktop and web.
Example:
Result := Argument_ColWidth;
if Argument_EntryName = "DESCRIPTION" then
Result := 240;