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 18:30:13
 
 
À
02/02/2001 18:11:39
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
Information générale
Forum:
Visual FoxPro
Catégorie:
Classes - VCX
Divers
Thread ID:
00472020
Message ID:
00472057
Vues:
33
Cetin,

Thanks much! That seems to work. I already had the form as a private datasession, i just couldn't get the right record to pass to it. That really helps. It just doesn't work the first time you go into the grid, which I can get around. All the other times it seems to work.

Thanks again

>David,
>The cursor should have a unique key field already. Directly use it, ie:
>lnKey = eval(thisform.myGrid.recordsource+'.KeyField')
>In your modal form it would be good to use a private data session and in its init you could say :
>
lparameters tnKey
>=seek(tnKey, 'TableName','KeyFieldTag')
>Cetin
>
>>Hi Joel,
>>
>>Thanks. I'm playing around with Afterrowcolchange. I think it may have potential. The problem is still after my form runs, focus is returned to the textbox, which I assume re-fires the when of the textbox, which seems to cause afterrowcolchange to fire again, which gives me the endless loop again. I'll keep tyring various combinations, though, and see if I can get it to work.
>>
>>>>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
>>>
>>>If you have the grid cursor in the data environment of the entry form, that could cause problems with the record pointer. If the problem is related to the event you are choosing, you might try the AfterRowColChange event of the grid.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform