Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Unbound Textbox in grid
Message
From
31/01/2003 00:26:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
30/01/2003 08:38:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00746878
Message ID:
00747522
Views:
31
>The problem maybe that the Column.ControlSource is set to wtkgs in the building code and then I have to set it to "" in the Init of the txtGridWtLbs control :
>
>* * txtGridWtLBS : init : 14:50 Wednesday 01/29/2003"
>local oColumn
>oColumn               = this.Parent
>this.cControlSource   = this.controlsource
>oColumn.Bound         = .f.
>oColumn.ControlSource = ""
>this.controlsource    = ""
>oColumn.Sparse        = .f.
>cControlRef = "this." + oColumn.Name + "." + this.Name + ".cal_lbs()"
>oColumn.DynamicCurrentControl = cControlRef
>this.ToolTipText = "Weight in " + this.cKgLbs
>
>
>Also as you can see my cal_lbs (your calpounds) has to be a method in the txtGridWtLbs control for reasons of encapsulation.
>
>I do not know exactly what is the problem. Any further ideas would help.

Why is the code in the init of the textbox? Seems to be a little too early to set column's properties - if memory serves me, contained objects in VFP are created (and their .init stuff run) before the containing objects, so the code in the textbox.init should run before the .column.init, and before the grid.init.

One thing I've learned about manipulating grids is that any custom setup code should come later - in grid.init. Maybe I'm wrong, but you may try to move the code there and see if it behaves better. Of course, keep track of it in the debugger, just like Nick said. I've learned more about grids from the debugger than from books and help combined.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Previous
Reply
Map
View

Click here to load this message in the networking platform