Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New approach to avoid grid reconstruction
Message
De
06/11/2001 08:33:19
 
 
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00493470
Message ID:
00577894
Vues:
19
Vlad,

I have been using your new approach for some time and it has worked quite well. I am now running into a problem. When I disable the grid refreshing I receive the error INDEX DOES NOT MATCH TABLE. There isn't even an index on the table at that point. Is there a property in the grid somewhere that might be referencing an index somewhere?

Matt

>Hi!
>
>Di you know that BeforeRowColChange event is fired each time when grid is going to be reconstructed? It happens in any case include when grid alias closed, view requeried etc. despite grid visibility, focus and grid configuration. the most amazing is that putting NODEFAULT in this event for duration of data changes prevents grid reconstruction at all!
>
>Old method:
>
>
>thisform.Grid1.RecordSource=""
>... && do requery of data
>thisform.Grid1.RecordSource="MyAliasWithNewData"
>* than restore control sources of all columns
>
>
>Now you can do following:
>
>
>thisform.GridRefreshing = .T. && tell all grid controls that grid data going to be requeried
>... do data requery
>thisform.Refresh && or grid refresh
>thisform.GridRefreshing = .F.
>
>
>In the BeforeRowColChange of grid event put following:
>
>if PEMStatus(thisform,"GridRefreshing",5) AND thisform.GridRefreshing
>    nodefault
>    return
>endif
>
>
>You can put above in the grid class.
>
>The most fun is that this method do not require to organize restoring of the control sources of all columns.
>
>Unfortunately, there are no way to know the reason why BeforeRowColChange event is called inside of that event to distinguish if it is called for recornstruction or movement between cells or some other actions with grid. Just use a flag for that.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform