To define the record sources in a grid can be a pain, so what I did
was to make the data source definition more like a List Box.
To do that, in my grid base class I have a property named ColumnDataSource.
I simply populate that with something like Address.Street,Town,County,Postcode.
The INIT code to achieve this is below.
Whilst looking at my code to post to you I noticed that I may have had the same
trouble as you, but not as an FIC application - the LockColumnsCount part of the code.
This code has run for 12 years with over 200 users over a network and never had a problem,
but not yet tested under FIC conditions.
In the base class INIT -:
**************************************************
LOCAL cDataFields, cTableName, nLC, cMacro
* If, for example, there are three fields in Grid data source, but column
* count is set to 2, sometimes, particularly over a network, the grid
* columns are shifted to the left.
IF THIS.LockColumnsCount > -1
IF THIS.LockColumnsCount=0
THIS.LOCKCOLUMNS=THIS.COLUMNCOUNT
ELSE
THIS.LOCKCOLUMNS=THIS.LockColumnsCount
ENDIF
ENDIF
* Not a lot lot of validation here, as not much use when EXE built.
IF NOT EMPTY(THIS.ColumnDataSource)
cDataFields=STRTRAN(THIS.ColumnDataSource, " ", "")
cTableName=SUBSTR(cDataFields, 1, AT(".", cDataFields) -1)
cDataFields=SUBSTR(cDataFields, AT(".", cDataFields) + 1) + ","
THIS.RECORDSOURCETYPE=1
THIS.RECORDSOURCE=cTableName
FOR nLC=1 TO OCCURS(",", cDataFields)
cMacro="This.Column" + ALLTRIM(STR(nLC)) + ".ControlSource='" + ;
cTableName + "." + SUBSTR(cDataFields, 1, AT(",", cDataFields) -1) + "'"
&cMacro
cDataFields=SUBSTR(cDataFields, AT(",", cDataFields) +1 )
ENDFOR
ENDIF
IF EMPTY(THIS.RECORDSOURCE)
MESSAGEBOX("The RECORDSOURCE has not been set in object" + CHR(13) + ;
SYS(1272, THIS) + ".", 48, ;
"Developer Message")
CANCEL
ENDIF
************************************************