The PeoleCode below will prevent users from inserting more than 2 rows on a grid. The "+" button will disappear the moment a 2nd row is added by a user. I have place this code on a record field under rowinit event. why because with out Getrowset()(Scroll.Rec Name) by default the active row count will be 1.So the condition is satisfied for first row.For second row it'll not satisfy the condition So it cannot accept to insert 2nd row.
If GetRowset().ActiveRowCount = 1 Then
GetRowset().InsertEnabled = True;
If GetRowset().ActiveRowCount = 1 Then
GetRowset().InsertEnabled = True;
Else
GetRowset().InsertEnabled = False;
End-If;
GetRowset().InsertEnabled = False;
End-If;
No comments:
Post a Comment