Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grids 101 - why am I so lost ?
Message
De
15/12/2006 09:55:49
Dragan Nedeljkovich (En ligne)
Now officially retired
Zrenjanin, Serbia
 
 
À
14/12/2006 22:35:05
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Divers
Thread ID:
01177450
Message ID:
01177970
Vues:
42
>My grid has the following columns:
>Item, Qty, Desc, Units, Price & Extended Amt
>
>Item is the combo dropdown that has its ControlSource=InvDetail.ItemCode. Its RecordSource=Products.ItemCode
>
>Qty's ControlSource=InvDetail.Quantity
>
>Desc's ControlSource=m.CurrentItemDesc
>
>Unit's ControlSource=m.CurrentItemUnit (Units are lbs, feet etc.)
>
>Price's ControlSource=InvDetail.Price
>
>Extended's ControlSource=InvDetail.Price * InvDetail.Quantity
>
>
>The big change was with Desc and Units: previously their ControlSources were Products.ItemDesc and Products.Units. Now they are memvars...
>
>To summarize the problem:
>=========================
>If a column's combo box (Drop-down style) has its RecordSource set to a child table, say PRODUCTS, do NOT set any other columns to have their ControlSource set to this same table (PRODUCTS). If you do, the combo's drop down list will lose focus for a brief instant as VFP tries to update these other column(s) that are bound to PRODUCTS. That means incremental searches in the combo's drop down list will not work, as the keystrokes are lost every time the combo loses focus...
>
>The solution: if you need to have other column(s) that display values (field or calculated) from the same child table as the combo's RecordSource, set these other column's ControlSource to a memvar. Then in the combo's Valid method, update the memvar(s) with the values from the child table (and do a refresh of the column).

I'm still amazed that it works for multiple rows... may be some weird combination of sparse(ness) of those m. columns. Since the grid actually has only one row (the other rows are the images of the current row, saved during refresh, when each row becomes current for an instant), if your memvars were regularly updated for each row, or if they were used for current row only, this may work. Is the controlsource for the column set to the field in Products and the controlsource of its textbox to the memvar? That may do it, though I never tried.

A possibly more stable workaround would be to separate the rowsource of the combo from the products table. You could just open the same table again under a different alias, and use that alias as the rowsource, then jump to the same record in it when leaving the combo.

back to same old

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

Click here to load this message in the networking platform