Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid RowColumn Change
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
00026366
Message ID:
00028024
Vues:
63
There is a property for both a row and a column, so you can just check to see which one changed.

BeforeRowColChange()
this.nOldRow = this.row
this.nOldCol = this.col

AfterRowColChange()
if this.row <> this.nOldRow AND this.col <> this.nOldCol
wait window "Both row and col have changed."
else
if this.row <> this.nOldRow
wait window "Row has changed"
else
wait window "Col has changed"
endif
endif

There ya go.

Michael G. Emmons

>>
>> Without seeing how it was done in the vfp samples, I would suggest creating
>> a grid class and adding to it a lastrow and lastcolumn property. In the
>> BeforeRowCol change method put some code in to assign the current row and
>> column to the appropriate properties. Then, in your AfterRowColChange even
>> you can just check to see if one, the other, or both have changed.
>
>In those examples, there is one thing I've never seen anywhere - when
>you track events in grid - it shows number of rows i.e. if you change
>from col 2 to col 1, these events are fired: AfterRowColChange(2)
>BeforeRowColChange (1), and if you stay within the same col, but change
>row, it fires AfterRowColChange(1) BeforeRowColChange (1). I'm not
>really sure how this works, but it's without any additional properties
>(which I'm using really much) and seems to be easy to implement.
>hth
>Dezider
>> >>
>> >> >How do you differentiate between a row or column change in a grid.
>> >> RowColumnChange is just sent a number so it could be either one. I'm
>> trying
>> >> to stop a row change when the user has modified a record. Thanks.
>> >>
>> >
>> >Take a look at tracking events in vfp samples.
>> >I think that you find what you want.
>> >Dezider
>> >--
>
>--

Michael G. Emmons
memmons@nc.rr.com
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform