Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Test for row change in grid
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00542790
Message ID:
00543310
Views:
28
This message has been marked as the solution to the initial question of the thread.
>>>>>I want to test for a user moving from one record (row) to another in a grid. I can figure out how to do this. Any help would be appreciated.
>>>>
>>>>Add new property nRecno to your grid base class and the following code to the grid AfterRowColChange event
* AfterRowColChange event
>>>>IF Recno(This.RecordSource) <> This.nRecNo   && Row changed
>>>>   This.nRecNo = Recno(This.RecordSource)
>>>>   * Some code
>>>>ENDIF
Don't forget to initialize nRecno property in the Init of the grid.
>>>
>>>Sergey - thanks for the reply and the code. I set up a grid as you suggested but nothing happens when I move around in the grid. This is the first time I've changed a base class but the nRecno property show in the PEM for the grid. I copied and pasted your code into the grid AfterRowColChange event. Any other ideas?
>>>Thanks again.
>>
>>Did you add This.nRecNo = Recno(This.RecordSource) to the Init of the grid?
>>What is the RecordSource of the grid? This code would work with 1-Alias only.
>
>Sergey - This.nRecNo = Recno(This.RecordSource) is in the Init event of the grid and the record source is 1-Alias. I'm stumped!

Put SUSPEND just before IF statement and check values in the debuger.
--sb--
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform