Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Why are the rows in my grid disappearing
Message
 
 
À
16/03/2007 10:10:48
Information générale
Forum:
Visual FoxPro
Catégorie:
Codage, syntaxe et commandes
Divers
Thread ID:
01204335
Message ID:
01204501
Vues:
21
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
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform