Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Can not remove objects in the Form's Load?
Message
 
General information
Forum:
Visual FoxPro
Category:
Other
Miscellaneous
Thread ID:
00341285
Message ID:
00341373
Views:
28
>I did this exactly already. But, it seems like grid's child Init method executes before grid Init method itself. So, this approach doesn't work, because, as I said, all columns are defined in design-time, I mean, each column has ControlSource property set in design-time. Threfore, if my form received the table with different structure, one of column Init method failed, I assume. I traced in the debug: it successfully goes through Load method, then immediately stops. At this point Grid.Init method isn't even executed.
>
> Another solution is to temproraly delete these grids, add them again and place remove grid in one of the other form's control Init method. But this solution beats OOP conception, I think...
>
> What else can I try? BTW, this is probably not the case in our app, because the table will always have all required fields, but if this problem could be easily solved, I prefer to solve it...

Is there any way for you to write in such a way as to have the controlsources set programmtically? For example, in the framework I use (VMP) there is a method called from thr Grid Init that sets the controlsources for all the columns. If you did it this way, then the Grid could return .F. and not initialize. If it passed your test, then the default behavior would be to call the new method.

Just an idea.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform