Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Refreshing command button in a grid column
Message
From
12/07/2001 11:26:23
Cetin Basoz
Engineerica Inc.
Izmir, Turkey
 
General information
Forum:
Visual FoxPro
Category:
Forms & Form designer
Miscellaneous
Thread ID:
00529691
Message ID:
00529748
Views:
10
This message has been marked as a message which has helped to the initial question of the thread.
>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.

Nadya,
Use one of Dynamic properties to fake. Check FAQ section (and IMHO place the button in a container).
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform