Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid event order
Message
From
16/05/2019 14:58:20
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Grid event order
Miscellaneous
Thread ID:
01668663
Message ID:
01668663
Views:
132
I ran into something weird this morning. I'm pretty sure I know how to work around it, but curious whether anyone else has noticed and if there's a way to prevent it.

I have a grid class that's using MemberClass to specify a custom Column class (colBase). The custom Column class, in turn, has a custom Header class. In the relevant form, I've replaced the default textboxes with a custom textbox class. I added some code to the column's class Init that uses a custom property of the column, but when it runs, it doesn't see the value (assigned in the PropSheet) of that property.

I noticed in the debugger that when running the Init code for the columns, it wasn't referring to the columns by their assigned names, but as colBase1, etc. So I turned on Event Tracking and got this (I've removed some irrelevant bits):
...
42706.654, frmchooseproducts.Load()
42706.674, frmchooseproducts.grdproducts.colbase1.Init()
42706.684, frmchooseproducts.grdproducts.colbase2.Init()
42706.694, frmchooseproducts.grdproducts.colbase3.Init()
42706.704, frmchooseproducts.grdproducts.colbase4.Init()
42706.704, frmchooseproducts.grdproducts.colbase5.Init()
42706.714, frmchooseproducts.grdproducts.colbase6.Init()
42706.714, frmchooseproducts.grdproducts.colbase7.Init()
42706.724, frmchooseproducts.grdproducts.colbase8.Init()
42706.736, frmchooseproducts.grdproducts.colbase9.Init()
42706.782, frmchooseproducts.cmdclose.Init()
...
42706.793, frmchooseproducts.grdproducts.colstockno.header1.Init()
42706.794, frmchooseproducts.grdproducts.colstockno.txtreadonly1.Init()
42706.794, frmchooseproducts.grdproducts.colstkdesc1.header1.Init()
42706.795, frmchooseproducts.grdproducts.colstkdesc1.txtreadonly1.Init()
42706.796, frmchooseproducts.grdproducts.colstkdesc2.header1.Init()
42706.797, frmchooseproducts.grdproducts.colstkdesc2.txtreadonly1.Init()
...
That is, the column Init is running before the Inits for the header and textbox in the column. I checked on a form with a default grid, and of course, it went from the inside out, so the header and textbox Inits ran before the column Init.

Anybody explored this deeply and have any understanding to share? As I said, I'm pretty sure I know how to work around in a generic way, but it's quite a shock.

Tamar
Next
Reply
Map
View

Click here to load this message in the networking platform