Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid Control
Message
De
30/08/2000 15:52:55
 
 
À
30/08/2000 15:38:37
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Titre:
Divers
Thread ID:
00410967
Message ID:
00410975
Vues:
14
>When using an SQL select to generate a temporary table to use as the recordsource for a grid display on a form, the initial display presents correctly. The columns and headers are individually formatted and color selected as well as the enabled properties are set per field from the temporary file.
>
>When reselecting the data and issuing the form.grid.recordsource to the temporary table generated, as in the initial code, the resulting grid looses all of the formating, color, and enabled properties.
>
>Any ideas as to how to correct this issue?

When the grid's recordsource cursor disappears out from under the grid, everything gets lost.

My approach is usually to use a view for grid source and REQUERY() the view - that way the cursor doesn't go away.

If not using a view, before recreating the cursor, blank the RecordSource.
However, you have to store/restore the controlsource of each column - e.g.,
** assuming grid1 is directly on the form
WITH thisform.grid1
  lcRecordSource = .RecordSource
  lnGridCol = .ColumnCount
  DIMENSION laGridInfo(lnGridCol,1)
  FOR jiCol = 1 TO lnGridCol
    laGridInfo[jiCol,1] = .Columns(jiCol).ControlSource
  ENDFOR
  .RecordSource = ""

**
** cursor recreation goes here
**

  .RecordSource = lcRecordSource
  FOR jiCol = 1 TO lnGridCol
     .Columns(jiCol).ControlSource = laGridInfo[jiCol,1]
  ENDFOR
ENDWITH
Insanity: Doing the same thing over and over and expecting different results.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform