Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
New approach to avoid grid reconstruction
Message
 
 
À
12/04/2001 02:45:31
Information générale
Forum:
Visual FoxPro
Catégorie:
Autre
Divers
Thread ID:
00493470
Message ID:
00494810
Vues:
23
Hi!

I guess you do not need to clear record source. Just try to assign it again:
Thisform.grdGrid.recordSource = Thisform.grdGrid.recordSource

I did figured out that after some Grid.Refresh calls in some cases grid attempts to reconstruct self again. It looks like it "remember" that something bad happened to its record source, so it tries to reconstruct self again. After I re-assign record source by mentioned abive way, it stops to attemt reconstruction. I did not get crashes. However, this looks like a reason of crashes in your application.

>>Hi!
>>
>>Hmm, interesting. Looks like it requires more investigating. In all test I ran it caused no a single crash. Can you describe more what you did to get crash, so I can reproduse it at my computer?
>
>Things are starting to get a bit wierd...
>
>I have done some work on the grid baseclass yesterday - I did have some code in the refresh method which bascially sets up column widths for the data in the grid, re-sets Dynamic colours etc.
>I have taken this out (for another reason) and this seems to have stopped the C..005 error
>
>This is the code (run from a listbox when) to re-query the grid.
>
>
>Thisform.grdGrid.GridRefreshing = .T.
>Thisform.grdGrid.recordSource = ''
>
>lcTemp = Addbs(Getenv('temp'))
>Select cat.*, ;
>	rc.plng_mode, ;
>	rc.dplyt_mode,;
>	rc.dsp_mode, ;
>	rc.frzn_hz, ;
>	rc.hold_wk_hz, ;
>	rc.dstn ;
>	FROM Prod_ctg cat;
>	RIGHT OUTER JOIN Prctg_rc rc ;
>	ON cat.prod_ctgr = rc.prod_ctgr ;
>	Where rc = This.Value ;
>	Into Table (lcTemp + 'BrowDisp')
>
>Thisform.grdGrid.recordSource = 'browDisp'
>Thisform.grdGrid.GridRefreshing = .F.
>
>If I run this code it works fine.
>If I comment out the 2 lines saying RecordSource = '' and RecordSource = 'browDisp'
>It gives the error 'Index does not match the table. Delete the index and re-create the index' on the Select statement. (I tried reindexing the 2 tables involved - did not help)
>
>I don't know what index is getting involved in this - maybe some internally created index during the select.
>
>I can't really give you any more information about this at the moment - but I will keep looking into it.
>
>Thanks
>
>Will
>
>P.S. The Gridrefreshing property trick does work really well (it's sorted out a few problems here).. I think what i'll do is create an assign method which blanks the recordsource automatically when the property is changed.
Vlad Grynchyshyn, Project Manager, MCP
vgryn@yahoo.com
ICQ #10709245
The professional level of programmer could be determined by level of stupidity of his/her bugs

It is not appropriate to say that question is "foolish". There could be only foolish answers. Everybody passed period of time when knows nothing about something.
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform