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: 51054 # Views: 33 # Ratings: 0
Version: Visual FoxPro 7 Category: Grids
Date: Wednesday, September 08, 2004 2:17:01 PM         
   


Hi Khozema

> I added this code to the refresh method of the grid
> This.clmlogin.dynamiccurrentcontrol = IIF(This.clmstatus.text1.value="R","cmdlogin","cmdlogind")
> On running the form it gives an error "Invalid expression" for Dynamic Current Control
> Sorry Andi But I need this functionality to be added very badly.

I am sorry, the help file is not very clear on this, but the actual code must go INTO the DynamicCurrentControl as an expression that can be evaluated.

In other words it is the actual expression that you have to put there, NOT the result. SO delete that from the Refresh() and instead put this in the Init() of your grid:

This.clmlogin.dynamiccurrentcontrol = [IIF(This.clmstatus.text1.value="R","cmdlogin","cmdlogind")]

NOTE THE "[]" AROUND THE EXPRESSION! It will not work without these.

That should do it.

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