Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: Andy Kramek
  Where is Andy Kramek?
 Hot Springs Village
 Arkansas - United States
 Andy Kramek
 To: Khozema Adenwala
  Where is Khozema Adenwala?
 sanaa
 Yemen
 Khozema Adenwala
 Tags
Subject: RE: Auto Enable / Diable command button in grid
Thread ID: 50831 Message ID: 50833 # Views: 50 # Ratings: 0
Version: Visual FoxPro 7 Category: Grids
Date: Monday, September 06, 2004 1:13:36 PM         
   


Hi Khozema

> I need to add this functionality in a grid control.
> I have a column whose current control property is set to command button.
> I need to auto enable - disable these command buttons according to a value
> being set for a record in another column . This will be done thru a timer event
>
> When I try to set the timer event to detect the value in a column and according to
> that value enable / disable the command buttond all the command buttons get
> enabled/disabled and not according to values set for the records in that particular
> column

I think this is a similar problem to the one with the caption.

But this time there is a solution - check out the DynamicCurrentControl property of the grid column.

Basically this allows you to define TWO controls in a column and to switch between them based on some value. So what you do is to add two buttons, one enabled, and one disabled, and then use an IIF() expression to evaluate which control to make visible.

Regards
Andy Kramek
Microsoft MVP (Visual FoxPro)
Akron, OH, USA

ENTIRE THREAD

Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/6/2004 1:07:03 PM
RE: Auto Enable / Diable command button in grid Posted by Andy Kramek @ 9/6/2004 1:13:36 PM
RE: Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/7/2004 10:43:33 AM
RE: Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/7/2004 11:24:07 AM
RE: Auto Enable / Diable command button in grid Posted by Andy Kramek @ 9/7/2004 1:23:41 PM
RE: Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/8/2004 1:11:36 PM
RE: Auto Enable / Diable command button in grid Posted by Andy Kramek @ 9/8/2004 2:17:01 PM
RE: Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/11/2004 7:53:41 AM
RE: Auto Enable / Diable command button in grid Posted by Andy Kramek @ 9/11/2004 1:38:12 PM
RE: Auto Enable / Diable command button in grid Posted by khozema adenwala @ 9/11/2004 9:54:14 PM
RE: Auto Enable / Diable command button in grid Posted by Andy Kramek @ 9/12/2004 3:44:27 PM
RE: Help needed From Andy Posted by khozema adenwala @ 9/13/2004 8:34:15 AM
RE: Help needed From Andy Posted by Andy Kramek @ 9/13/2004 1:14:10 PM
RE: Auto Enable / Diable command button in grid Posted by John Barrie @ 6/1/2017 2:30:47 PM
RE: Auto Enable / Diable command button in grid Posted by Catalin Banici @ 5/12/2006 2:10:54 PM