Sylvain,
Grids like to snap:) If a table is open and no recordsource exists then it'd pick up the one it finds first. If you don't set recordsource you could see which cursor/table it picked up.
Workaround is as Sergey noted:
WITH THIS.grdBrowse
.ColumnCount = -1
.RecordSource = this.cTable
endwith
Cetin
>On my form, I have a grid with ColumnCount = -1. In the Init of the form, I have the following code:
THIS.grdBrowse.RecordSource = THIS.cTable
When the form open, the grid display the table contents, but only the first 8 fields. How come?
>
>
Update: I'm still interested to know why only the first 8 fields are displayed, but for the record I found a workaround:
lnFieldsCnt = AFIELDS (laFields)
>
>WITH THIS.grdBrowse
> .ColumnCount = lnFieldsCnt
> .RecordSource = "MyTable"
>
> FOR I = 1 TO lnFieldsCnt
> .Columns (I).Header1.Caption = laFields [I, 1]
> ENDFOR
>ENDWITH