Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Column ControlSource && DynamicBackColor Assign
Message
From
13/02/2002 08:43:46
 
 
To
13/02/2002 08:11:33
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00619330
Message ID:
00619400
Views:
16
>>>>
>>>>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 :
>
>
*Grid.init
>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

Cetin,

Guess I'll start profiling the grid's init and see.

Whilst the time it takes is of major importance, my aim is to find the assign.

Setting the ColumnCount to -1 is something I cannot do. By the time the Class.Init() is fired, too many properties of the grid and columns may have changed. The only solution I see (for the moment) is to add new columns, copy the properties from old to new, and deleting the old columns. The ControlSource of any column is not necessarily the table of the RecordSource by the time I get to the Class.Init().

My grid class is loaded enough as it is for the moment
- all CurrentControls are replaced with a subclassed control depending on the type of the ControlSource
- Grid is displayed as left last time (columnorder, width, ...)
- headers which enable to sort asc/desc, even allow filters with dropdowns (a la excel). Filter status is saved and restored

Thanks,
Gregory
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform