Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Addnew event in grid?
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00449399
Message ID:
00449594
Vues:
8
Hi!

Point noted!

I was just trying to show a different way of doing it.

In some cases it is useful but it some it may not be that useful, it just depends on the case.

There are some limitations with the GETFLDSTATE() function though, like, if you have default values setup for that cursor and when the user adds a new record those field(s) get the default value(s) and this functions tells you that field(s) got edited even though the user did not edit them or if users make a change and then undo (ctrl-z) it which brings it back to its original value even then it tells you that it changed.

I use it a lot in my FW to disallow multiple blanks records etc. (among other things) I don't know how I could handle it in a more easier/cleaner way.

Sarosh


>>Hi!
>>
>>Use the GETFLDSTATE() function in the AfterRowColChange event of the grid to check if the current record is a new one or not.
>>
>>For more details please refer to the GETFLDSTATE() function.
>>
>
>On second thought about GETFLDSTATE(). It might not give you what's required in this particular case. GETFLDSTATE() can tell that the record was added, but does not say when. For example, if you have the table buffering, the added record(s) will have "3" (or "4" ) in the GETFLDSTATE() return value until they are committed. So, moving the record pointer through those records will trigger the code again. Therefore I think my approach still has a point as it compares the record count before and after moving the record pointer and can tell that it is a new record for sure. I can't give it much more testing rght now. Also, I might be overlooking something simple again. :)
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform