Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid format disappears when datasource changed
Message
From
30/12/1997 12:19:18
Jeff Tucker
Mackinac Center For Public Policy
Midland, Michigan, United States
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Grid format disappears when datasource changed
Miscellaneous
Thread ID:
00068445
Message ID:
00068445
Views:
76
I used the grid builder wizard in VFP 5.0, and selected the ledger feature to make every other line of the grid green.

The builder placed the following code in the dynamicBackColor of the columns of the grid to alternate the green.
IIF(MOD(RECNO(),2)=1,RGB(255,255,255),RGB(192,220,192))

I set the following properties on the grid.
recordSource = qprTotals
recordSourceType = 1-Alias

I want to change the data that appears in the grid based on the selection of a radio button. When the user selects a button, a query is constructed and run. The query refreshes the data in qprTotals.

SELECT ;
INTO CURSOR qprTotals

Then I specify the recordSource and refresh the grid.

Thisform.grdTotal.RecordSource = "qprTotals"
Thisform.grdTotal.refresh

The grid immediately loses its formating. The proper header captions change to query field names. The grid becomes grey and ordinary. The only thing that works is I get the correct data each time I click a different button.

Am I going about this wrong? How can I make the grid retain the formating?
Next
Reply
Map
View

Click here to load this message in the networking platform