Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
SetAll
Message
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Re: SetAll
Miscellaneous
Thread ID:
00526124
Message ID:
00526143
Views:
20
When I added dodefault(m.nColIndex) as the last line in AfterRowColChange event, everything seems to work properly again...

>Hi everybody,
>
>I got some strange behavior with SetAll. I instantiate a grid in form's Init method. Then I do:
>
thisform.grdBldMstr.SetAll('DynamicForeColor','thisform.myForeColor(BldMstr.'+thisform.addrfield+')','column)
.
>
>Everything works fine so far. This is the code I have in Grid AfterRowColChange event:
>
>********************************************************************
>*  Description.......: grdAddrStd.AfterRowColChange
>*  Calling Samples...:
>*  Parameter List....:
>*  Created by........:
>*  Modified by.......: Nadya Nosonovsky 06/29/2001 11:23:00 PM
>********************************************************************
>lparameters nColIndex
>local lnReccount, lnRecno
>lnReccount=reccount('BldMstr')
>lnRecno=recno('BldMstr')
>with this
>	*.parent.grdHglt1.Highlight_Row()
>	if .nCurRec<>m.lnRecno
>		.nCurRec=m.lnRecno
>		thisform.NavStand.navupdate()
>		thisform.edtNotes.refresh()		
>		if thisform.ProcType='prclproc'
>			if thisform.grdSitus.visible or thisform.grdOwner.visible
>				thisform.RequeryGridSources()
>			endif
>		endif
>	endif
>	.statusbartext=space(20)+"Record "+ transform(m.lnRecno)+" of "+ transform(m.lnReccount)+ ;
>		" in BldMstr"
>endwith
>
>This is the code of RequeryGridSources method:
>
********************************************************************
>*  Description.......: AddrStdMain.RequeryGridSources()
>*  Calling Samples...:
>*  Parameter List....:
>*  Created by........: Nadya Nosonovsky 06/30/2001 01:26:29 PM
>*  Modified by.......:
>********************************************************************
>lparameter tnPropID
>if vartype(m.tnPropID)<>"N"
>   tnPropID=BldMstr.PropID
>endif
>local lcDBC
>if vartype(oJC)='O' && Normal case
>	lcDBC=oJC.CurState
>else
>	lcDBC='MA' && for test purposes
>endif
>set step on
>with thisform
>	if .grdSitus.visible
>	   .grdSitus.recordsource=''
>		select iif(prefcode='P',padr('Primary',11),'Alternative') as AddressType, ;
>			ccode, town, StNum, StNumExt, Street, LotCode, Unit, ZipCode ;
>			from (m.lcDBC+'!SiteMstr') where PropID=m.tnPropID ;
>			order by AddressType descending ;
>			into cursor curSitus
>		.grdSitus.recordsource='curSitus'
>		select BldMstr
>	endif
>	if .grdOwner.visible
>		.grdOwner.recordsource=''
>		select ownerstnum, ownerStExt, OwnerStrt, OwnerUnit, OwnerCity, ;
>			OwnerState, OwnerZip5, OwnerCtry ;
>			from (m.lcDBC+'!OwnrAddr') where PropID==m.tnPropID ;
>			into cursor curOwner
>		.grdOwner.recordsource='curOwner'
>		select BldMstr
>	endif
>endwith
>
>At the beginning I was trying to use GridHighlighter, but I noticed, then I change Grid height programmatically, thisform.myForeColor method fires again and again many times. Ok, I commented out lines with changing grid height, but then I navigate from record to record, thisform.myForeColor fires many times again. Finally I commented out lines with gridhighlighter, but I still got this problem. It looks like, if I change alias in grid AfterRowColChange method, I got SetAll method executing (this is my guess about that's actually happening). Can somebody confirm this behavior? What can I do about it? It slows down movement between records dramatically :((((((
If it's not broken, fix it until it is.


My Blog
Previous
Reply
Map
View

Click here to load this message in the networking platform