This sounds awfully like a case of patella luxation. This is when the knee cap moves out of the little groove it usually runs in and then pops back in. It is also called patella dislocation. An operation to deepen the groove may be needed and is very succesful if this is the problem. This can be hereditary in nature so the dog should not be used for breeding. Let us know what the vet says.