Hi, Karsten!
Once you assign the Grid Recordsource, VFP will Drop all the Columns and child (Control) Objects...
and then Recreate the default one with current field list.... (if you set field to field1, field2, field3...)
So, it must take long time to do so and you lose everything code if you put directly on grid... ~_~
At file section, there is a Browse Table (bwtable.zip ) which is an example of using a grid to show data in Current Directory!
What I need to mention:
With ThisForm.Grid1
.RecordSource = []
.ColumnCount = -1
.RecordSouce = tcRecordSource
For ix = 1 to .ColumnCount
.Columns[iX].RemoveObject("text1")
.Columns[iX].AddObject("newText1", "myTextClass")
.Columns[iX].newText1.Visible = .T.
Endfor
.Refresh
EndWith
SO, you can simply keep code as a new class and put them in grid at INIT ^_^"
>Why does this line takes such a long time to be executed in the Init of my grid?
>
>this.RecordSource = tcRecordSource
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.