Try changing it as follows :
LOCAL lnOldSelect, lnKounter, lcControlSource
lnOldSelect = SELECT()
lnKounter = 0
SELECT GridColumns
WITH MyGrid
.ColumnCount = RecCount() && THIS IS THE BIG CHANGE
.RecordSource = pcTableName
SCAN
lnKounter = lnKounter + 1
.COLUMNS(lnKounter).Header1.CAPTION = GridColumns.ColumnName
.COLUMNS(lnKounter).READONLY = .T.
lcControlSource = pcTableName + [.] + ALLT(GridColumns.GridColumn)
.COLUMNS(lnKounter).CONTROLSOURCE = (lcControlSource) ENDSCAN
ENDWITH
SELECT (lnOldSelect)
Previous
Next
Reply
View the map of this thread
View the map of this thread starting from this message only
View all messages of this thread
View all messages of this thread starting from this message only