Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid source refill - what was the order of moves
Message
De
12/06/1998 18:03:06
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Grid source refill - what was the order of moves
Divers
Thread ID:
00107753
Message ID:
00107753
Vues:
89
One formset, two forms. One form is visible, and has a grid; in some rows, in third column, sometimes there's a word denoting an alias of the table to be opened in a grid in the other form (activated via grid.column3.text1.click if not empty()). All the tables have the same structure (so they should, they're .scxes); in the other form the grid actually shows a cursor taken from the table, showing only records corresponding to editable controls.

Here's the other form's Activate:

ThisForm.Grid1.recordsource=""
_dscx=forceext(trim(ThisFormset.FORM1.Grid1.Column3.Text1.value),"scx")
=zatvori("scx,dscx") && this closes them
create cursor scx (naziv c(40), user m, userline c(80), rcn i)
do otvori with _dscx,"","alias dscx" && this opens the table
* here I fill the cursor with values for the records I need
scan for not empty(classloc)
_property=properties
_aln=atcline([ControlSource =],_property)
if _aln>0
m.naziv=wordnum(mline(_property,_aln),2,["'])
m.rcn=recno()
m.user=user
m.userline=mline(user,1)
insert into scx from memvar
endif
ends
* so far so good, this all works
sele scx
ThisForm.Grid1.recordsource="scx"

The trouble is that this works only the first time form2 is invoked - the second time and later the grid columns reset to default, instead of those I have designed, showing all columns instead of only two (specifically I'm sad for losing code which should run on any cell's click event).
This second form is closed via thisform.hide, and activated via thisformset.form2.activate (tried with .show, too, but that doesn't bring it to top); form2 is initially invisible.

Now what important lesson from two thousand messages on grids have I forgotten? I remember Ed has done it in four lines lately, and I seem to have these four wrong, and can't find the message right now. I thought I'll know it off the top of my head once I need it, but I was wrong.

back to same old

the first online autobiography, unfinished by design
What, me reckless? I'm full of recks!
Balkans, eh? Count them.
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform