Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Gotcha in grid
Message
From
26/11/1998 12:41:11
 
General information
Forum:
Visual FoxPro
Category:
Other
Title:
Miscellaneous
Thread ID:
00161419
Message ID:
00161803
Views:
19
Pete,

Sorry 'bout that. I misunderstood the issue.

FWIW, I was readily able to reproduce the behaviour and I think I have an explanation, though I doubt it's satisfactory. The "problem" appears to lie in the way VFP implements inheritance. When a grid class defined with .ColumnCount = -1 is added to a form and the .ColumnCount property is set to n columns (on the form), VFP adds n header and text1 instances (records) to the .scx. However, when the .ColumnCount property is set to 2 (in your example) in the class definition, VFP only stores records for header1 and text1 instances 3 through n in the .scx. It stores .Name information for header/text1 instances 1 and 2 in the properties of the Grid itself, but there are no instances (records) for these 2 instances in the .scx, as that information is going to be inherited from the class. In any event, in the scenario you described you are, in effect, asking VFP to delete records for Column1.Header1/.Text1 and Column2.Header1/.Text1.

You can see this behaviour by inspecting the relevant .vcx and .scx. While I agree with you that this behaviour appears to be rather anomolous, I suspect MS would say that it is by design.

Again, I apologise for pointing out the obvious in my first reply. Hope I haven't done it again :)

-DaveR


>>An instance of a class can't have fewer members than the class definition itself. That is, you cannot delete members. This is true of Grids, PageFrames, OptionGroups etc. You can always add members (ie more columns, pages, buttons) in the form designer but you can't remove them (or define them as containing fewer members).
>>
>>HTH,
>>DaveR
>>
>>
>>
>>Hello All,
>>I discovered this natty little feature in VFP 6 today.
>>
>>To reproduce:
>>
>>1) Create a form and add a grid ( based on your grid class ).
>>2) Close the form.
>>3) Modify the grid class making ColumnCount = 2 or whatever.
>>4) Save the class.
>>5) Open your form make a change to the grid and try to save it.
>>6) I get the message "Member object removed - cannot complete the save operation (Error 1756)
>>7) Set the grid class back as before ( ColumnCount = -1 ).
>>8) Open your form, make a change to the grid and save it.
>>9) No problem.
>>
>>Anyone experienced this?
>>
>>Regards
>>Pete Kane.
>
>David,
>I changed the baseclass to ColumnCount = 2, my class instance had ColumnCount = 4, I'm aware you can't remove members which is why I posted the message, I would be grateful if you could try to repeat my findings, BTW any change you make will incur this message, all I did was change the form caption containing a grid of the same class
>
>Thanks a lot
>Pete Kane
Previous
Reply
Map
View

Click here to load this message in the networking platform