Search This Blog

Friday, March 9, 2012

Hiding a row in a grid

&rs(&i).visible=false;

"rs" is the rowset of the grid. i.e &rs = getrowset(sroll.RECNAME);
"i" -- represents row of the grid.
 Let us take a scenario where we want to hide employee rows who are contractors
Sample grid data
Sno   Emplid  Name  EmpType
1       14201   Kiran      P 
2       14202   Krishna  C
3       14203   Ravi       P   

Now , I want to hide Contractor. In this case it is Krishna.
So I will traverse through the rowset

Buffer values of the grid before hiding the rows.
1 Kiran
2 Krishna
3 Ravi

for &i=1 to &rs.activerowcount

if  &rs(&i).EMP_HIRE_DTL.EMP_TYPE = "C" then
&rs(&i).visible = false; 
end-if;
end-for;

Buffer values of the grid after hiding the rows.

1 Kiran
2 Ravi
3 Krishna

Hope the above info is useful.

No comments: