Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Grid properties correct but no records show
Message
De
05/07/2007 13:23:32
 
 
À
05/07/2007 10:35:55
Information générale
Forum:
Visual FoxPro
Catégorie:
Gestionnaire d'écran & Écrans
Versions des environnements
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
MS SQL Server
Divers
Thread ID:
01237901
Message ID:
01238008
Vues:
15
The manipulation of the grid recordsource is basically a 'just in case' which shouldn't occur. I check to see if the recordsource is incorrect and set it only if it is. I set the recordsource in another method which does the query and sets it and then calls the grid refresh.


>You should use Grid.Setfocus instead of Refresh to show grid records (refresh works in 99% cases, setfocus- always). Another hint, if relevant, no manipulations with grid recordsource should be done when focus is on grid.
>
>>Yes, sometimes there are no records at all and the table does not exist.
>>
>>>Why do you want to go hard way (changing grid's RecordSource, etc.) Are you actually changing the record source for the grid?
>>>
>>>
>>>>Nevermind, it was a simple thing of selecting the table in the refresh of the grid. I had that line of code there and somehow in my changes I cut it out without realizing it. In all of my reviews I didn't notice it was missing. Looked at it too much I guess. Silly me... :o)
>>>>
>>>>
>>>>
>>>>I have a form with a pageframe and 3 pages. On page two is a grid which displays records in a table. There are fields on page2 which display all of the values in the current row in the grid. A new record can be added to the table on page2 by keying a value in a field on page1. When a value is keyed into a field on page 1, a routine steps through the table and looks for a matching record. If one is not found, then the record is added. The grid on page2 is then refreshed. In the refresh method of the grid, the grid's recordsource is set and all of the other properties of the grid as well. The recordsource is set to '' first, then to the table, then all of the columns' properties are set. Then the dodefault is run. If more than one record already exists in the table when the new record is added, then the grid refreshes fine. However, if there were no records and this is the first record being added, then I can see the fields on page2 populated correctly, but no record shows
>>up
>>>>in the grid. when I look at the grids properties and even the value in one of the textboxes in a column, it is populated with the value in the table yet it appears by looking at the grid that either it is not bound correctly or there are no records in the table. Any ideas?
.·*´¨)
.·`TCH
(..·*

010000110101001101101000011000010111001001110000010011110111001001000010011101010111001101110100
"When the debate is lost, slander becomes the tool of the loser." - Socrates
Vita contingit, Vive cum eo. (Life Happens, Live With it.)
"Life is not measured by the number of breaths we take, but by the moments that take our breath away." -- author unknown
"De omnibus dubitandum"
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform