Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid columns controlSource
Message
From
19/07/2000 21:45:04
 
 
To
19/07/2000 04:34:29
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00392786
Message ID:
00394687
Views:
9
>
>Terence,
>I'm simply lost. What's expected with the above scenario is to get TableA data and what you get is TableA data :) Why would I get TableB I can't understand. With that code in grid.init it's very normal I would lose formatting and controlsources (code in columns and their controls in turn) but still I would get TableA and I get it. I deny that absolutely TableA must be selected first but I'm aware that there might be cases where you should.
>(why I feel myself as the defender of lovely grid control:)
>Cetin

Maybe I use a simple word to say:

Grid work normal when used in DO FORM version (normal create and put in scx) but
it don't work properly on Init if the Current Work Area is NOT the same as recordsource for other create method:
such as CreateObject("NewFormClass1_WithGrid_in_it") or ThisForm.AddObject("grdClass1","mygrid")
if Empty Current work area, give a openfile prompt to you...
if different Current work area, use the current one instead!

That's, if you only use grid in Do Form only, you don't get the bug.

So, I give the following procedure to show how the bug does! You are welcome to try it, just about 5 mins to do.
Sometimes programmer make different current work area for real needs,
such as loading the LastSave table to get back the user preference, then the grid show the LastSave data..

Anyway, on comparing grid and listbox bugs... I also prefer to use grid!! ;O
What I highlight is how to prevent some unexpected & unbelievable VFP bugs..


>>

>>
>>The first point make me very angry!! Computer don't work as my coding told!! What a Computer language!!!
>>If you want to try how the poor facts do:
>>
>>1) make a form class named fTest and give a grid on it with recordsource "TableA"
>>2) at Ftest.Load, you need to put the coding on loading DE:
>>
>>
>>* Ftest.load
>>If !used("TableA")
>>  Use TableA again in 0 order tag KeyA shared
>>endif
>>
>>=CursorSetProp("buffer", 5, "TableA")
>>
>>If !used("TableB")
>>  Use TableB again in 0 order tag KeyB shared
>>endif
>>
>>=CursorSetProp("buffer", 5, "TableB")
>>
>>SELECT TABLEB    && Change the Current Work Area to TableB, this make you CRY!!
>>
>>
>>3) make a form to call the class:
>>
>>Set Classlib to myCls.vcx additive
>>public fTest1
>>fTest1 = CreateObject("fTest")
>>fTest1.Show
>>
>>

>>This's all, you will find that the Grid MUST show TABLEB data even you adding coding on Grid.Init:
>>
>>This.Recordsource = ''
>>This.ColumnCount = -1
>>This.Recordsource = "TableA" && unbelievable, this line of code is ignored!
>>
>>It still show TableB data and Ignore your last coding on assigning Recordsource!!! Angry!? /._.\"
>>Of cos, all your controlsource assignment is lost!!
>>
>>
The weak wait for chance, The strong bid for chance,
The clever notch up chance, but The merciful give you chance.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform