Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Grid by genxtab cursor
Message
 
 
To
20/01/2004 07:02:54
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00867912
Message ID:
00868537
Views:
23
Chaim,

The crosstab result is a cursor, so it can be the RecordSource of the grid.

do (_genxtab) with "xtabresult"
thisform.grdXTab.RecordSource = "xtabresult"

>I didn't understand dow can I put the crosstab query into cursor and to use with this cursor for grid record source.
>PS
>1. My code not populate the grid, but if I press on the design mode and again on the run, after the form appeared the grid populated with the crosstab data.

This sounds like you have no RecordSource assigned to the grid on the property sheet, and no currently seleccted workarea. Then you run your form from the designer. If there is no currently selected workarea the grid remains blank. I assume you create the crosstab from some action like a button.Click(). But since this is after the the grid has been instantiated it does not bind to the grid. But after the xtab is generated you've left that as the current workarea. Close the form, the designer opens again, immediately rerun it and now your grid shows the xtab. It shows it now because it was the the selected workarea when the grid was instantiating.

The code above shouldjust correctly setup your grid once the xtab is calculated.

>2. There is an option that the wide grid columns will be set automaticly to the max(len) of every column (the longest data row of this column - not less and not more)?

In VFP8 you can use the new AutoFit features, but they size the columns based on the currently displayed rows only. I've griped all along that this feature should have a mode that works across all rows.

In other versions you can scan the table and calculate a maxwidth for each column and assign that value to the grd.Column[i].Width.
df (was a 10 time MVP)

df FoxPro website
FoxPro Wiki site online, editable knowledgebase
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform