Function GridFieldByName(GridField: String) : Field
Description
Gets a reference to a field object on the basis of a grid field name. Use this reference to change grid field properties like the displaylabel, displayformat, decimals, readonly, visible etc.
Parameters
Remarks
Use this function in the InitializeGridFields event handler.
Check for each referenced grid field if the object exists. Setting properties of a grid field which not exists results in errors during execution of the script.
Code Snippet
'Change some properties of a gridfield
Set
fldFA = frmEditForm.GridFieldByName(
"FinAmount"
)
If Not
fldFA is nothing
Then
fldFA.DisplayLabel=
"MyFinAmount"
fldFA.DisplayFormat =
"##.##"
fldFA.Decimals =
2
fldFA.ReadOnly = True
fldFA.Visible = True
End If