Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Question
Message
From
15/11/2002 04:47:58
 
 
To
14/11/2002 13:34:54
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Title:
Miscellaneous
Thread ID:
00722833
Message ID:
00723100
Views:
9
This message has been marked as a message which has helped to the initial question of the thread.
Hi!

You require to set RecordSource property to "" BEFORE you close the record source that was there. Otherwise, as soon as grid see that its record source is closed or gone away from visibility scope, grid will be completelt reconstructing. In other words, the code for changing record source should be following:
* first of all, clear the record source
thisform.Grid1.RecordSource=""

* close previous record source alias, do requery, PACK, re-create cursor etc. - whatever actions 
* needed to refresh data
* ....

* set record source back for grid
thisform.Grid1.RecordSource="MyNewAlias"
You can read more about grid reconstrcution and columns re-binding (there is another problem as well) in the VFP Grids Part I article on this site.

>Hello
>
>I have some code in the keypress event of a textbox in a grid (based on a table) and i have a command button to delete the contents of the table.
>
>what's happening is first time when form is run keypress event works fine,but when command button is clicked and grid gets refreshed by setting recordsource="" and again resetting the keypress doesn't fire.
>
>how to make the keypress to fire after the delete.
>
>
>txs
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform