Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

grid's setall

Status
Not open for further replies.

sqlpro

Programmer
Dec 30, 2003
297
NZ
hi friends

whats the problem following command.

Grid1.SetAll("ReadOnly",iif(curAss.ASS_COMP=1 OR ;
!UPPER(ALLTRIM(THIS.sdummy3))==UPPER(ALLTRIM(gcstaffid)),.T.,.F.),"Column")

it does not disable column as required.
by the way what is my requirement is the column 5 in the grid bound to curAss.ASS_COMP
and i want apply abv iif condition
is there any other way plz

cheers
 
to add to abv the column 5 has custom checkbox as active control.
Thanks :)

cheers
 
ok i finally tried like this
Grid1.column5.SetAll("enabled",iif(curAss.ASS_COMP=1 OR ;
!UPPER(ALLTRIM(curAss.staffid))==UPPER(ALLTRIM(gcstaffid)),.F.,.T.),"chkcomplete")

it works but its working on only 1st row

cheers
 
That's because the statement is only evaluated once, and whatever record CurAss is pointed to is what is used for all rows. You'll need to use your code in each column's WHEN method instead. To prevent you from having to repeat this code, you can either use a special class for this, or if you're using VFP 8, you can use BindEvent to make the When method to run the code.


-BP (Barbara Peisch)
 
Hi

In

Column5.Text1.When
******************
RETURN (curAss.ASS_COMP=1 OR ;
!(UPPER(ALLTRIM(THIS.Grid1.sdummy3))==UPPER(ALLTRIM(gcstaffid)))

**************************
1. Suitably change Text1, if the control is called something else.
2. Make sure This.Grid1.sdummy3 and gsStaffId is suitably changed as suits the convention.

:)

____________________________________________
ramani - (Subramanian.G) :)
 
Hi Ramani
i tried abv code in grid columns when (active control is a custom checkbox) but still it does not disable rows as required.


cheers
 
i wrote in like
column5.chkcomplete.when

*!* return when this assignment is not logged in user added by rajani on 24/03/2004
RETURN (curAss.ASS_COMP=1) OR ;
(!UPPER(ALLTRIM(curAss.staffid))==UPPER(ALLTRIM(gcstaffid)))

cheers
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top