Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Borislav Borissov
  Where is Borislav Borissov?
 Borislav Borissov
 To: Robert Hayward
  Where is Robert Hayward?
 California - United States
 Robert Hayward
Subject: RE: Commam Button in Grid
Thread ID: 189167 Message ID: 189170 # Views: 1 # Ratings: 0
Version: Visual FoxPro 9 SP2 Category: Windows Vista and VFP
Date: Wednesday, August 13, 2008 3:59:09 PM         

> I am trying to place a button in a grid (did that) but I want the button caption to reflect the value of the field value. The field table.locked is a logical field if .t. I want the button to say 'LOCKED' else 'UNLOCKED'. the column sparce is .f. to display the button but all the captions are set to the last value in the table. Can anyone help?
> Thank you all so much
> Robert T. Hayward

Try this:
Create a new method named SetButtonCaption in Form and then:
*** Form Init Event
thisform.Grid1.ColumnWithButton.DynamicBackColor = [thisform.SetButtonCaption()]

**** Form SetButtonCaption method
thisform.Grid1.ColumnWithButton.ButtonName.Caption = IIF(Table.Locked,[LOCKED],[UNLOCKED])
RETURN thisform.Grid1.ColumnWithButton.BackColor

not tested

Borislav Borissov

Against Stupidity the Gods themselves Contend in Vain - Johann Christoph Friedrich von Schiller
The only thing normal about database guys is their tables.


Commam Button in Grid Posted by Robert Hayward @ 8/13/2008 3:54:37 PM
RE: Commam Button in Grid Posted by Borislav Borissov @ 8/13/2008 3:59:09 PM
RE: Commam Button in Grid Posted by Stefan Wuebbe @ 8/13/2008 4:00:19 PM