How 'bout this?

Code:
        Procedure OnClick
            Handle hoDataSource
            Integer iSize
            tDataSourceRow[] tGridData

            Get phoDataSource of oCJGridMike to hoDataSource
            Get DataSource of hoDataSource   to tGridData
            Move (SizeOfArray(tGridData))    to iSize
            If (iSize > 0) Begin
                //get/set your selected row details 
                Send Request_InsertRow of oCJGridMike
            End
            Else Begin
                Send Request_AppendRow of oCJGridMike
            End
        End_Procedure