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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Graying out an entire grid using PeopleCode !!?!!

Status
Not open for further replies.

Guest_imported

New member
Jan 1, 1970
0
Hi,

I need to gray out an entire grid on a page using PeopleCode.

Can anyone help me on this one.

Thanks and Regards,
Abhijeet
 
Abhijeet,
Your out of luck if you were hoping that there would be a nice function that could gray an entire grid in one go. The only way to do it is to gray each field on the grid, this is not too bad in version 8+ PCode, but can be a real pain in 7.5.
The best way to do it in 8 is to use a variable to grab the record that the Grid relates to
&oRecord = GetRecord(RECORD.Record1);
and then you can go
&oRecord.Field1.Enabled = Flase;
&oRecord.Field2.Enabled = False;
etc

Pete
 
Hi,
I think theres also a better way to do this is V8 ...tell me if I am wrong with it ......below is a nice piece of code to do this (i.e. Hide an Entire Grid)

/*-----------------------------------*/

Hiding the entire GRID: (Hiding all rows or rather rowset)

Hiding a grid

This can be done by means of rowset class only.

Local rowset &gridrs;

&gridrs=getrowset(Scroll.<record name>); (get the rowset accdg to the levels)
&gridrs.Hideallrows();


Example involves hiding level 2 grid from level 1 code.

&RS1 = GetRowset();
&RS2 = GetRowset(SCROLL.EMPL_CHKLST_ITM);
For &I = 1 to &RS1.ActiveRowCount
If ALL(&RS1.GetRow(&I).Recname.fieldname) Then
&RS2.HideAllRows();
End-If;
/*other processing */
End-For;

Tip: To again show the GRID use the method “SHOWALLROWS” instead of “HideAllRows” in the above example.

/*-----------------------------------*/
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top