Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. file info. rss.
 From: mike castillo
  Where is mike castillo?
 Joo Seng Road, Singapore
 Philippines
 mike castillo
 To: Borislav Borissov
  Where is Borislav Borissov?
 Sofia
 Bulgaria
 Borislav Borissov
 Tags
Subject: RE: How to disable a button in a cell of a grid?
Thread ID: 112210 Message ID: 112278 # Views: 2 # Ratings: 0
Version: Visual FoxPro 7 Category: Grids
Date: Tuesday, November 07, 2006 1:18:49 AM         
   


> > > Hi all,
> > >
> > > I created a form with a grid. There are four columns in the grid and assigned a cursor on it. On each column I assigned a command button making the entire grid populated with command buttons depending on the number of records the cursor has. Now my question is, how can I disable a particular button in any cells of the grid? For example, when I clicked a particular button I want that button to be disabled.
> > >
> > > Thanks
> > >
> > > foxwizard
> > > Systems Analyst-Philippines

> >
> > Where are you going to use this? What is the field Type of your Cursor?
> >
> > if its a logical types then:
> >
> > I suggest you use a checkbox with the Style property set to 1-Graphical. then Try to use AfterRowColChange Method of your Grid. Where in this method you will have a code like:
> >
> > thisform.grid1.column1.checkbox1.enabled = iif(Table.Field1,.F.,.T.)
> > thisform.grid1.column2.checkbox1.enabled = iif(Table.Field1,.F.,.T.)
> > thisform.grid1.column3.checkbox1.enabled = iif(Table.Field1,.F.,.T.)
> > thisform.grid1.column4.checkbox1.enabled = iif(Table.Field1,.F.,.T.)
> >
> > This is just to give you an idea, Take note I have not fully tested the code above.
> >
> > Mike

>
> Mike,
> When you dealing with Logical types there is no need of IIFs
>
> thisform.grid1.column1.checkbox1.enabled = NOT Table.Field1
> thisform.grid1.column2.checkbox1.enabled = NOT Table.Field1
> thisform.grid1.column3.checkbox1.enabled = NOT Table.Field1
> thisform.grid1.column4.checkbox1.enabled = NOT Table.Field1
> 

>
> Borislav Borissov
>
>


heheheheheh you are right Boris. Thanks.

ENTIRE THREAD

How to disable a button in a cell of a grid? Posted by foxwizard @ 11/6/2006 7:39:33 AM
RE: How to disable a button in a cell of a grid? Posted by tushar @ 11/6/2006 7:51:49 AM
RE: How to disable a button in a cell of a grid? Posted by mike castillo @ 11/6/2006 10:10:41 AM
RE: How to disable a button in a cell of a grid? Posted by Borislav Borissov @ 11/6/2006 10:32:09 AM
RE: How to disable a button in a cell of a grid? Posted by mike castillo @ 11/7/2006 1:18:49 AM
RE: How to disable a button in a cell of a grid? Posted by foxwizard @ 11/7/2006 5:39:07 AM
RE: How to disable a button in a cell of a grid? Posted by Ken Murphy @ 11/7/2006 1:32:04 PM