Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Column ControlSource && DynamicBackColor Assign
Message
From
13/02/2002 09:26:18
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
 
To
13/02/2002 08:43:46
General information
Forum:
Visual FoxPro
Category:
Object Oriented Programming
Miscellaneous
Thread ID:
00619330
Message ID:
00619425
Views:
19
This message has been marked as a message which has helped to the initial question of the thread.
>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,

Greg,
I didn't mean set columncount to -1. It was just a sample procedure from one of my existing classes :) Naturally I don't expect your controlsources to match fields of a table in the same manner.
Here you say 'by the time init fired' causing me highly suspect this grid could be modified at designtime (builder). ie:
-I don't know what the recordsource would be
-But just before saving my form I know columncount is set, how it 'would' look like

So I take 2 possible routes :
1) While designer open I select the grid, aselobj() and replace the grid with my own version. scx now would have my version where most or all of init code is now not needed (columns, headers, controls are now subclassed ones).

2) Before saving the form I would add a temporary dummy button with code :
thisform.myGrid.SaveAsClass(...)
Save the form and run, wait 2-3 secs of upload time once :), click the button to create the class. Then I would dismiss the grid on form and put saved class instance (placing just a comment in init would be sufficient to override previous init code).

Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform