Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
How do I know which record in a grid has focus?
Message
De
02/02/2001 17:10:48
 
 
À
Tous
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Titre:
How do I know which record in a grid has focus?
Divers
Thread ID:
00472020
Message ID:
00472020
Vues:
70
I have a client doing data entry in a grid with complex business rules. Heeding the advice of many developers far more knowledgable than I (and the extensive difficulty of similar past implementations), I am moving the actual data entry to a form, from which I can easily handle the conditional processing and interface.

I want to simulate the a grid-looking entry, so I've created a long narrow form with no header and the same number of fields and text boxes as the grid. The issue I'm now facing is how do I know which record of the grid the user clicked in, so I can pass that paramter to the form. I'm using a view to populate the grid. The user can click on any line in the grid, and I want to pop open my little form with that same data.

I can get the form to pop open precisely over the row in which the user clicked, which is pretty cool. But I can't get the right record number from my view. I've tried opening the entry form from the WHEN of one of the grid's textboxes, but when I try to find which record I'm in, it always gives me either the first record (if the grid didn't previously have focus) or the record I last was in. I tried the GOTFOCUS event of the text box, but that created all sorts of crazy behavior with the form - the textbox would get focus, then open my modal form, then get focus again, etc. etc. leading to an infinite loop.

I have a few more things I'm going to try, but I was wondering if anyone had any thoughts or similar experiences, or perhaps an entirely different approach.

Thanks in advance,

David
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform