Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Creating an event on the fly
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Miscellaneous
Thread ID:
00515711
Message ID:
00515786
Views:
17
>OK here is my problem:
>My grid has "MyTable" as RecordSource and "1-Alias" as RecordSourceType
>When i click on a record in the grid the information in that record is posted in some textboxes on the form. To do this i have "thisform.refresh" in the click event of Grid1.Column1.text1
>
>So far i have only used the form designer to make the form with the grid and everything works great.
>
>Then I added a Delete-button that deletes the current selected record in MyTable and to do this I use:
>"delete" and then "pack"
>
>After the record has been deleted and the table packed the grid is blank ie. all its properties are set to default.
>
>So my solution to this was to just set all the properties and methods on the fly, but I ran into problems when I got to the click event.
>
>Has anyone ever encountered a problem like this?
>How would you go abouts solving this?
>
>Thanks
>Einar

Einar,
Yes I have seen this. The PACK is the problem in association with the grid. Do you have to issue a PACK? If yes, you may be able to set the RowSource of the grid to space(0) (NULL string), issue the PACK and then reassign the grid's rowsource and each column's ControlSource (if needed). That way the grid won't have to be rebuilt from scratch. All the method code for all the previously existing Headers and Columns will still be operational.

Having said that, I suggest you stay away from PACK while the user is viewing the data. Using the SET DELETED ON internal filter should suffice for not displaying deleted records to the user. If you need to issue a PACK, you can do it in the form's Destroy event. The form will not be visible to the user at that time so you don't have to worry about "fixing" things.

HTH.
Larry Miller
MCSD
LWMiller3@verizon.net

Accumulate learning by study, understand what you learn by questioning. -- Mingjiao
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform