Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing command button in a grid column
Message
 
 
To
All
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Title:
Refreshing command button in a grid column
Miscellaneous
Thread ID:
00529691
Message ID:
00529691
Views:
38
Hi everybody,

I have a grid on the form wich content I change, when navigating in the main grid. In one of the column I put a command button, set its sparse property to .f. and this code in its Refresh method:
this.enabled= (curSitus.AddressType'Not linked ')
Here is the code, which updates this grid content:
********************************************************************
*  Description.......: AddrStdMain.RequeryGridSources()
*  Calling Samples...:
*  Parameter List....:
*  Created by........: Nadya Nosonovsky 06/30/2001 01:26:29 PM
*  Modified by.......: Nadya Nosonovsky 07/02/2001 09:46:48 PM
********************************************************************
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
with thisform
     if .grdSitus.visible
          if m.tnPropID>0
          *     .grdSitus.recordsource=''
               select iif(prefcode='P',padr('Primary',11),'Alternative') as AddressType, ;
                    ccode, town, StNum, StNumExt, Street, LotCode, Unit, ZipCode, SiteID ;
                    from (m.lcDBC+'!SiteMstr') where PropID=m.tnPropID ;
                    order by AddressType descending ;
                    into cursor curTemp
               if _tally>0
                select curSitus
                zap
                append from dbf('curTemp')
               else
                 if reccount('curSitus')=0
                    insert into curSitus (AddressType) value ('Not linked') 
                 endif   
               endif       
          *     .grdSitus.recordsource='curSitus'
              .grdSitus.refresh()
               select BldMstr
               use in select('curTemp')
          endif
     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'
*!*          endif
endwith
select BldMstr
The button is always enabled, even if AddressType='Not linked '. Do I need to refresh this button explicitly, IOW, grid refresh is not enough?

Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Next
Reply
Map
View

Click here to load this message in the networking platform