Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid loses columns when bound view is refreshed
Message
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Divers
Thread ID:
00394485
Message ID:
00394492
Vues:
11
>We use views and bind them to grids in our forms. When we requery the view (by issuing USE dbname!viewname), the grid.columncount goes to zero because the bound table is temporarily lost. The grid then shows up as a white box with nothing in it.
>
>We are coming up with some complex work arounds for this, but wanted to know if there is a simple solution to not losing the grid columns in the first place.
>
>Any ideas?
>
>
>Greatly Appreciated :)
>
>
>Thanks

I found that if I am using a view or a cursor for a grid and I need to close the view/cursor and reopen it I had to set the record source to:

C40grdLotCardData.RECORDSOURCE = ''

Then I would do my Select or Requery in your case USE dbname!viewname

Then I would set the record source back

.RECORDSOURCE = 'lotdata'

And then ensure that the columns are ok with:

.C40grdLotCardData.Column1.CONTROLSOURCE = 'lotdata.frnfrn'
.C40grdLotCardData.Column2.CONTROLSOURCE = 'lotdata.lotnumber'

Then refresh the grid:

.C40grdLotCardData.REFRESH()

Hope this helps or gets you in the right direction
Bret Hobbs

"We'd have been called juvenile delinquents only our neighborhood couldn't afford a sociologist." Bob Hope
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform