Deletion when pbMultipleSelection is set to true
When setting pbMultipleSelection to True, deleting records the Grid class only ever deletes one record. Please can the following code be add to class so that it deletes all selected records.
Ta!
Code:
{ MethodType=Event DesignTime=False }
Function MultiRowDelete_Confirmation for cUIObject Returns Integer
Function_Return (confirm(Self, "Delete all Selected records?"))
End_Function
{ MethodType=Method }
Procedure Request_Delete
Handle[] hoaSelectedRows
Boolean bCancel
Integer iCount iSelectedCount iVerify_Delete_msg
Get Verify_Delete_msg to iVerify_Delete_msg
If (pbMultipleSelection(Self) = True) Begin
Get GetIndexesForSelectedRows to hoaSelectedRows
Move (ReverseArray(hoaSelectedRows)) to hoaSelectedRows
Move (SizeOfArray(hoaSelectedRows) - 1) to iSelectedCount
For iCount from 0 to iSelectedCount
Send MoveToRow (hoaSelectedRows[iCount])
If ((iSelectedCount > 0) and (iVerify_Delete_msg > 0)) Begin
If (iCount = 0 ) Set Verify_Delete_msg to (RefFunc(MultiRowDelete_Confirmation))
Else Set Verify_Delete_msg to (RefFunc(No_Confirmation))
End
If (not(bCancel)) Forward Send Request_Delete
If (Err) Move True to bCancel
Loop
Set Verify_Delete_msg to iVerify_Delete_msg
End
Else Begin
Forward Send Request_Delete
End
End_Procedure // Request_Delete
Martin Pincott
(Member of the SigCj project)