Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid format disappears when datasource changed
Message
From
30/12/1997 12:28:16
Jeff Tucker
Mackinac Center For Public Policy
Midland, Michigan, United States
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00068445
Message ID:
00068452
Views:
25
>>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?
>
>What I do is
>Thisform.grdTotal.RecordSource = ""
>SELECT ;
> INTO CURSOR qprTotals
>Thisform.grdTotal.RecordSource = "qprTotals"
>Thisform.grdTotal.refresh
>This maintains my grid formatting by setting the recordsource to nothing first.

That is bizarre. It worked and for that I am grateful. However, I am not sure why it worked.

Thanks so much,
Jeff
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform