You are viewing this site as a guest. You can still ask questions and help others! Join our Dev2Dev IT Community to receive your own blog, share your knowledge, and much more.

Gray out fields in a grid using classes using people code

1 reply [Last post]
ashok_star2004's picture
User offline. Last seen 1 year 1 week ago. Offline
Joined: 02/13/2009
Posts: 45

Hi!Can Any One tell me how to gray out grid fields using people code.i want to use rowset,rowclasses,etc..

Here's my code.but it is graying only the first row not all rows..Can u solve this to gray out all the grid fields..

Local Rowset &Level0_rs, &Level1_rs;
Local Row &Level0_row, &Level1_row;
Local Field &Level0_fld0, &Level1_fld1, &Level1_fld2;

&Level1_rs = GetLevel0();
&Level0_row = &Level1_rs.GetRow(1);
&Level0_fld0 = &Level0_row.GetRecord(Record.ERPA_AK_CUS1).GetField(Field.ERPA_AK_ORDRSTATUS);
&Level1_rs = &Level0_row.GetRowset(Scroll.ERPA_AK_CUS31);
For &I = 1 To &Level1_rs.ActiveRowCount
   &Level1_row = &Level1_rs(&I);
   &Level1_fld1 = &Level1_row.GetRecord(Record.ERPA_AK_CUS31).GetField(Field.ERPA_AK_ITEM);
   &Level1_fld2 = &Level1_row.GetRecord(Record.ERPA_AK_CUS31).GetField(Field.ERPA_AK_NUMITEMS);
   If &Level0_fld0.Value = "S" Then
      Gray(Record.ERPA_AK_CUS31, CurrentRowNumber(), ERPA_AK_CUS31.ERPA_AK_ITEM);
      Gray(Record.ERPA_AK_CUS31, CurrentRowNumber(), ERPA_AK_CUS31.ERPA_AK_NUMITEMS);
   End-If;
End-For;

Lepa's picture
User offline. Last seen 2 years 25 weeks ago. Offline
Joined: 06/23/2008
Posts: 591
Re: Gray out fields in a grid using classes using people code

I think you need to replace CurrentRowNumber() with &I. Did you try that?

Give back to the community and help it grow!
* Help with unanswered forum questions and issues
* Register or login to share your knowledge at your own blog