Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Replacing grid's Textboxes
Message
 
 
À
16/03/2001 06:02:02
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00485761
Message ID:
00485787
Vues:
10
Hi!

Grid reconstruction behavior, again. Reconstruction means full removing of all grid's controls and columns and creating it again using default VFP controls. This cause lose of all methods, property settings and objects in columns. It occurs in following cases:

1. RecordSource alias closed. If this is a view, reconstruction happens also
when you requery view. If it is SQL Statement, it happens when you assing
anotehr SQL Statement or just close alias user to store results of the query
for grid.

To avoid reconstruction when refreshing grid's record source, you require to assign empty string (not a one
space - " ", but empty string - "") to the Record source before any of above
actions. If you already do that, just check your code if you do that in
correct order. After refresh assign record source again.

2. When grid is initialized and record source is empty. Don't ever do this. If you need to open record source in some other event than load of form (before grid initializing), use following: in the load method create an empty cursor with the same structure as a record source for grid and record source of grid should be that empty cursor. Than when you open real data, assign empty string to grid's record source and than assign again real data alias.

3. When column count changed to 0 or -1

4. When alias goes out of scope. This means usually that you can assign
record source in one data session, but grid really initialized in another
data session. However, this may occur also in otehr situations when
programmer uses data sessions switching extensively.

HTH.

PS, I will post this to FAQ, too much threads on this topic...



>Hi,
>
>I have replaced all my baseclass grid's default textboxes with a subclassed version which is sitting in the same classlibrary as the grid.
>
>When I run all my forms which use this grid they all work fine (and have the correct subclassed textbox)
>Except for one...
>This one form seems to insist on using the default textbox for the grid - I have checked in debugger and it's definately not the correct textbox.
>
>I have tried deleteing the grid and re-inserting it
>I have tried packing the SCX
>I have tried re-building the entire project
>
>How can I get this form to use my grid's baseclass properly?
>
>Any suggestions welcome
>
>TIA
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform