Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Moving to a new row in a grid
Message
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00507094
Message ID:
00507171
Vues:
10
Hi!

If you look to the evants tracking utility to see what events are firing for grid, you will see that BeforeRowColChange fires before any other event. So there is no obvious way to distinguish the movement. You can do this by use of transparent grid cover for this and catching of the keys in the KeyPress event of the form when grid is focused. This way you will catch mouse clicks and keys that cause row/column changes. Quite messy, but it is possible, I can help more if needed. However, is this realy needed?

The only thing I know it is useful is to use nodefault in the BeforeRowColChange event to prevent to change row if data entered invalid in the grid. Well, use of the grid for data entering is quite bad interface layout idea at all. This is because a lot of trouble with grid to handle this.

Fortunately, in VFP7 there is a property of the grid that allows you to see what is going to change in the grid - row or column. I would like also a way to see if grid lost focus or record source going to reconstruct... (BeforeRowColChange fires also in other cases)

HTH.

>>How do I test that the user is moving to a new row in a grid before the current row loses focus.
>>
>>I have been working on this all day because I want to run a procedure using the current row's data only when a new row is selected.
>>
>>Any ideas?
>>
>>Thanks,
>>
>>Mitch
>
>Hi Mitch,
>
>I don't know, if it would help, but this is what I have. Our grid class has a property nCurRec. In AfterRowColChange event of the grid I check, if this.nCurRec<>recno(this.RecordSource) && (usually I just use a table name here), and if it doesn't, I execute some code and this.nCurRec=recno(). You can also use the similar code in BeforeRowColChange event. So, using this property, I can easily identify, was it movement between rows or between columns.
>
>HTH
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform