Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Scroll Event
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP2
OS:
Windows 7
Divers
Thread ID:
01527274
Message ID:
01527306
Vues:
50
>>How can you determine what records are visible?
>
>
>The only way I have found is to use a sort of Dynamicxxx(). Best is DynamicFontShadow()
>
>Have at least one column with
>
>  .DynamicFontShadow = [m.this.UpdateCollection(recno())]   && or record pk instead of recno()
>
>
>Add a grid method: UpdateCollection(id)
>Add a Collection to the grid
>
>
>Now, each time UpdateCollection is called, you can test whether the id is in the collection (empty(collection.getkey(transf(m.id)))
>If it is not in add it
>.Collection.add(m.id, trans(m.id))
>
>Each time the grid is refresh() or scrolled, the DynamicFontShadow will fire and you can add the Id's to the collection
>
>The DynamicXXX fire from left to right, top to bottom. The first one added will be the top visible row of the grid
>
>The key is to know when to clear the collection
>
>(1) Do a bindevent on grid.Refresh - the delegate must be called before the refresh - clear the collection. The refresh will refill it
>
>(2) Do a bindevent on scrolled - delegate must be called after scrolled
> if the direction was vertical, clear the collection, call grid.RefillCollection ( see below)
>
>(3) Do a bindevent on Resize - delegate must be called after scrolled
> clear the collection, call grid.RefillCollection ( see below)
>
>
>Add a property to the grid: HeightDelta, value 1
>
>RefillCollection forces the dynamicXXX to be re-evaluated for the visible cells in a grid
>
>
>&& Grid.RefillCollection 
>store -m.this.HeightDelta to this.HeightDelta
>this.height = m.this.Height + m.this.HeightDelta
>
>
>
>
>
>same principle - download#37149


Thanks. That very detailed solution helped immensely.
Brandon Harker
Sebae Data Solutions
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform