Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid shows up correctly only the first time
Message
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Grid shows up correctly only the first time
Versions des environnements
Visual FoxPro:
VFP 9
OS:
Windows XP SP2
Database:
Visual FoxPro
Divers
Thread ID:
01059678
Message ID:
01059678
Vues:
48
Hi everybody,

I put a grid in the container control what I instantiate on the fly on the form. In this grid I set first column to use checkbox, I specified grid's layout, etc.

I left RecordSource for the grid empty and control sources for the columns empty as well.

I have the following code in Init method of the container:
CREATE CURSOR cUsersList (lSelect L, cEmpName C(50), cUserID C(10), cPK C(16))
	INDEX on UPPER(cEmpName) tag cEmpName
	INDEX ON lSelect TAG lSelect
	INSERT INTO cUsersList (cUserID, lSelect, cEmpName, cPK) ;
	SELECT cUserID, .f. as lSelect, cEmpName, cUsgrlink_pk FROM c_AllUsers order by cEmpName
	GO TOP IN cUsersList
	this.grdUsers.RecordSource = 'cUsersList'
	USE IN SELECT('c_AllUsers')
E.g. I try to set RecordSource after the grid is already initialized.

Now, when I first instantiate this container on the form, the grid displayes correctly. But if I remove the container and try to add it again, the nice grid layout and checkboxes are lost.

The question is: why it works the first time and doesn't work the next time during form's life-time? How can I make it to work consistently correctly?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform