I have been working a lot with Grids lately and this is an example on how to hide an "Add" button under the grid so that users can only enter one row.
The comments between the code should explain what I'm trying to do here. But please, don't hesitate to ask if need be!
Local Rowset &RSEthnic;
&RSEthnic = GetLevel0()(1).GetRowset(Scroll.DIVERS_ETHNIC);
/* Check the rows in the grid after the user deletes a row. If a row exists then hide the
add button (user can only enter one Ethnic Group) */
If &RSEthnic.ActiveRowCount = 1 And
All(&RSEthnic.GetRow(1).DIVERS_ETHNIC.ETHNIC_GRP_CD.Value) Then
Hide(HR_LINK_WRK.ADD_PB);
End-If;
/* Check the rows in the grid after the user deletes a row. If a row exists then hide the
add button (user can only enter one Ethnic Group) */
If &RSEthnic.ActiveRowCount = 1 And
All(&RSEthnic.GetRow(1).DIVERS_ETHNIC.ETHNIC_GRP_CD.Value) Then
Hide(HR_LINK_WRK.ADD_PB);
End-If;
/* if no data left in the grid after the user performs a delete, then go ahead and show the
add button so user can add a new Ethnic group*/
add button so user can add a new Ethnic group*/
If &RSEthnic.ActiveRowCount = 1 And
None(&RSEthnic.GetRow(1).DIVERS_ETHNIC.ETHNIC_GRP_CD.Value) Then
UnHide(HR_LINK_WRK.ADD_PB);
End-If;
None(&RSEthnic.GetRow(1).DIVERS_ETHNIC.ETHNIC_GRP_CD.Value) Then
UnHide(HR_LINK_WRK.ADD_PB);
End-If;
0 comments:
Post a Comment
Phaniraavi@gmail.com