The information in this article applies to:
- Microsoft Visual FoxPro for Windows, version 3.0
SYMPTOMS
When changing the active record in a grid through an external mechanism
such as a command button, the record marker for the active record is not
displayed when the record changes.
RESOLUTION
See the example resolution given in the "More Information" section of this
article.
STATUS
This behavior is by design.
MORE INFORMATION
Steps to Reproduce Behavior
- In the Command window, run these commands:
USE SYS(2004)+"samples\data\customer"
CREATE FORM test
- Add a grid to the form.
- Add the VCR class from \VFP\Samples\Controls\BUTTONS.VCX.
- Save and run the form.
- Click the various VCR buttons.
The record has changed but the marker for the new or active record does not
display. If your status bar is on, you will see the record pointer moves
but the record marker does not.
Example Resolution
To correct this behavior, modify the VCR button code as follows:
- In the Command window, issue this command:
MODIFY FORM test
- Double-click the VCR buttons.
- Select the cmdTop.Click event, and type these commands:
=EVALUATE((this.parent.class)+".cmdTop::Click()")
THISFORM.GRID1.SetFocus
- Select the cmdPrior.Click event, and type these commands:
=EVALUATE((this.parent.class)+".cmdPrior::Click()")
THISFORM.GRID1.SetFocus
- Select the cmdNext.Click event, and type these commands:
=EVALUATE((this.parent.class)+".cmdNext::Click()")
THISFORM.GRID1.SetFocus
- Select the cmdBottom.Click event, and type these commands:
=EVALUATE((this.parent.class)+".cmdBottom::Click()")
THISFORM.GRID1.SetFocus
- Save and run the form.
- Click the various VCR buttons.
Now the record marker is displayed for the active record as expected.
|