Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid Refresh
Message
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Miscellaneous
Thread ID:
00511818
Message ID:
00511820
Views:
16
Anytime the recordsource is changed in a grid, certain properties revert to the default. The best way I have found make sure you keep your property settings is to subclass any grid that has a dynamic recordsource. Add a method to the grid that sets all the properties you want. Then whenever you need a new record source, do this:
grid.recordsource = ""
grid.recordsource = newsource
grid.setmycustomsettings()
To take that a step further you can design a grid that actually looks at a datasource and designs "itself" around that data.

Also, if you set persistent relationships in the database designer it is easier to sync two grids in a one-to-many relationship.

HTH

>Hi-
>
>I have two grids on a form. The top grid is the Master Record, and the bottom shows detail.
>
>When the MasterRecord is moved, in the AfterRolColChangeEvent
>I run a SQL to update the control source data used by the detail grid below, and refresh the data in that grid with:
>
>thisform.Jgrid1.recordsource=thisform.Jgrid1.recordsource
>
>Data is refreshed correctly but the bottom detail grid redraws and shows the data with no regard to how the control was initial established, including Column widths, headings, titles and positioning.
>
>This, of course, is not only undesired, it is extremely frustrating.
>
>Any suggestions or ideas as to what I am not doing, or doing incorrectly. I prefer not to go to a list box as it would not have headings.
>
>Thanks for any suggestions.
Eric Kleeman - EDS Consulting Services
MCP Visual FoxPro
MCSD C#.NET
Hua Hin Thailand
Los Angeles California
Previous
Reply
Map
View

Click here to load this message in the networking platform