Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Two controlsources in the same cell of a grid
Message
From
21/04/2006 01:22:57
Dragan Nedeljkovich (Online)
Now officially retired
Zrenjanin, Serbia
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Classes - VCX
Title:
Two controlsources in the same cell of a grid
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP1
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01115235
Message ID:
01115235
Views:
63
I have a column which needs to display (and, hopefully, allow editing of) character fields in two tables at the same time. The table contains a hierarchy, and the top two levels have this character field in table1 (which is the recordsource of the grid), however any lower level is linked to table2 (via a FK) and I need to display the proper field from that other table.

I have several containers, with two textboxes each. The first textbox displays the outline number (a field in table1), the other displays the character field - say, table1.cTitle for table1.level=1 or 2, and table2.cTitle for levels 3 and on. The containers are passed the level on .init, and are named cnt1, cnt2 etc. The column.dynamicCurrentControl="cnt"+tran(table1.level), and they show properly. Column.sparse=.f.

There's also some indentation involved, but that's not the problem.

The problem is that whatever I do, as soon as any of these containers gets focus, they all get table2.cTitle for controlsource - checked in the debugger. Since table2 is related via this FK, there's nothing shown in this column for levels 1 and 2.

Now is this another grid feature? I tried with and without the controlsource for the column. Why would the controlsource of a textbox in a column change?

back to same old

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

Click here to load this message in the networking platform