Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why are the rows in my grid disappearing
Message
De
16/03/2007 11:37:31
 
 
À
16/03/2007 11:29:19
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01204335
Message ID:
01204590
Vues:
26
It's extremely strange. If I would have this problem then my next step could be reducing grid complexity. Basically I would make just one column with simple controlsource and see how it's going.
Also, see what Terry said. I hope you have triggered call from Page.Activate to grid recreating code.

>Unfortunately, your experiment didn't change anything.
>
>>Do you mean that you call your 'grid recreating' code from form activate? Could you make a small experiment then? Call the same code from Page.Rightclick event ant try if right-clicking on the page fixes your grid. If it does then it will be easy to fix your form.
>>
>>>Naomi --
>>>
>>>All my grids have a "create" method which re-creates the underlying grid, sets the recordsource, deletes any existing columns, and then adds the columns that are necessary.
>>>
>>>I have many cases where the columns to be displayed are dependent on various user-enter parameters, so I have found it most convenient to always handle grids this same way.
>>>
>>>BTW, this problems occurs the first time I activate a page, so that's not an issue here.
>>>
>>>>Hi James,
>>>>
>>>>By delayed instantiation technique I mean, that for each page you have a container with all necessary controls inside (and pre-build grids in design-time). You instantiate the container first time in page Activate, something like:
>>>>
>>>>
>>>>IF TYPE('this.cntResolutions.name') <> "C"
>>>>	Private piResolution_Code, piID
>>>>	STORE 0 TO piResolution_Code, piID
>>>>	Thisform.AddProperty('oCAAllResolutions',Createobject('ca_AllResolutions'))
>>>>	Thisform.AddProperty('oCAResolutionProblem',Createobject('ca_ResolutionProblem')) && Related problems
>>>>	thisform.CreateCursors(2)
>>>>	If Thisform.oCAAllResolutions.CursorFill(.t.) And Used('crsAllResolutions')
>>>>		piResolution_Code = crsAllResolutions.iResolution_Code	
>>>>		Thisform.oCAResolutionProblem.CursorFill(.t.) && Get Related Resolutions
>>>>	Else
>>>>		Return .F.
>>>>	ENDIF
>>>>	LOCAL lnLen
>>>>	lnLen = ALEN(thisform.aCAObjects)
>>>>	DIMENSION thisform.aCAObjects[m.lnLen + 2]
>>>>	thisform.aCAObjects[m.lnLen + 1] = thisform.oCAAllResolutions
>>>>	thisform.aCAObjects[m.lnLen + 2] = thisform.oCAResolutionProblem
>>>>   this.NewObject('cntResolutions','cntResolutions')
>>>>   WITH this.cntResolutions
>>>>       .top = 10
>>>>       .left = 40
>>>>       .visible = .t.
>>>>   ENDWITH
>>>>ENDIF
>>>>
>>>>(Took all code from page activate of one of my latest forms).
>>>>
>>>>I'm not sure why do you need to re-build your grids everytime? Is there a particular reason for that?
>>>>
>>>>Thanks.
>>>>
>>>>>Naomi --
>>>>>
>>>>>The grids in this form initially exist but have no columns. When their page is activated, I add the new columns (removing any previously there from prior activations of the same page). Is this what you mean by "delayed instantiation technique"?
>>>>>
>>>>>Your other reference was interesting, but not of value. None of my records have NULL values.
>>>>>
>>>>>Curiously, the grids that fail normally work -- they only fail if particular pages have been visited beforehand. Now, I certainly understand how nefarious interactions in a form can be, but for the life of me I don't understand how it's possible to have a grid with a simple cursor as a recordsource, columns properly defined, but none of the records showing. (Vert. scrollbar acts like there are no records in the cursor -- grayed out.)
>>>>>
>>>>>
>>>>>>>This is a question that has been asked and answered before, but I don't seem to have any of the circumstances noted before.
>>>>>>>
>>>>>>>I have a pageframe, with grids on multiple pages. Each grid is rebuild from scratch (that is, the grid is created, the columns are all added programatically, and the recordsource assigned) when its page is activated.
>>>>>>>
>>>>>>>It appears that if the pages are visited in a particular order, some of the grids may not display any records. Now, I hasten to say, I can verify that the alias for the grid exists, has records, and is unfiltered; that the recordsource for the grid is correct; and that all the columns exist (their headers appear correctly, just no records) and have the correct controlsource.
>>>>>>>
>>>>>>>This doesn't appear to be just a matter of avoiding grid reconstruction, since I consciously build the grid and its columns as I need to.
>>>>>>>
>>>>>>>Any suggestions as to what might be causing this?
>>>>>>>
>>>>>>>TIA,
>>>>>>
>>>>>>Do you instantiate grids in code? Do you use delayed instantiation technique?
>>>>>>
>>>>>>I don't think this is relevant but just in case Re: Unhandled win32 error on down arrow in grid Thread #1138142 Message #1138144
Edward Pikman
Independent Consultant
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform