Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid anomoly trouble
Message
From
14/04/1998 23:44:35
 
 
To
14/04/1998 12:27:27
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00091787
Message ID:
00092023
Views:
28
>>I have a form that allows the user to navigate through recirds using a grid. Clicking on or scrolling to a record refreshes the data-bound controls on the form.
>>The form uses row buffering, so moving the record pointer in the grid issues a TABLEUPDATE(). This is the way that the user wants it.
>>The trouble comes because certain fields have rules that they need to follow before the data can be saved. No problem, I'll check the values against the rules in the beforerowcolchange event of the grid, and issue NODEFAULT if one of the fields fails. This works. The problem I'm having stems from two (IMHO stupid) features of the grid:
>>
>>1. a grid's beforerowcolchange and afterrowcolchange events fire when the grid gets focus.
>>
>>2. A grid's record pointer and dynamic properties are not updated with its refresh method, but with its gotfocus event.
>>
>>So if I change a value on the form of a field that affects one of the dynamic properties, I must set focus to the grid and then back to the current control. I could live with this except for that doing this fires my validation rules.
>>I figure I could get around this in one of two ways: refresh the grid's properties somehow without setting focus, or somehow determine in the beforerowcolchange event if the row or column really changed.
>>
>>Suggestions?
>
>Actually, grid reevaluates pointers in afterrowcolchange event (not in gotfocus), that's another story that gotfocus fires this event. I think you could call afterrowcolchange event (assuming that dynamic properties reset there) programmatically from some appropriate place in your program.

Though the record pointer might get updated in the afterrowcolchange event, running that event's method code doesn't do the trick. Any other suggestions?
Erik Moore
Clientelligence
Previous
Reply
Map
View

Click here to load this message in the networking platform