>>>
>>>the rest of the code is fine, it's just the addition of 86 columns and the deletion of the 'old' 86 columns, preserving all the properties of the 'old' columns, like ColumnOrder, and the like
>>>
>>
>>Greg,
>>For 86 columns even doing it like that shouldn't take 2.5 secs. However you can significantly cut down the time if you used one single line of code to set columncount instead of individually deleting old columns (as I undertand you're doing something like removeobject).
>>If this is not a must at runtime you could save load time by doing that in designtime too.
>>Cetin
>
>Cetin,
>
>I hear what you say, ie This.ColumnCount = xxx
>However, setting the columnCount that way will also make them 'standard' columns. and I need my Column Class
>
>With respect to changing the things at design time, I can say that I did such things when I was learning vfp. Now, I write code in the Init if the grid, which then calls the classInit(). The classinit() handles most of the stuff.
>
>Thanks
Greg,
You heard but partially :) That wouldn't leave you with standart columns but would 'drop' them :) Something like this :
Procedure init
Lparameters tcRecordsource
With this
.Columncount = -1
.recordsource = tcRecordsource
nOldColCount = .columncount
For ix = 1 to fcount(tcRecordsource)
.AddColumn(ix, tcRecordsource,field(ix,tcRecordsource))
Endfor
.Columncount = nOldColCount
Endwith
Endproc
Here what I do is to add columns to their 'standart' counterpart's position pushing 'standart' to end.
PS: I think you misunderstood my designtime suggestion. What I meant was if columncount, column formats etc would be static at runtime your 'grid' class could be changed in code at designtime.
Cetin