What is the meaning, origin and earliest use of the phrase "to take the biscuit"?
In the British comedy TV serial I am watching, the guy is upset because things are not happening as per his wishes. He is assembling a do-it-yourself baby cot for his daughter's baby, finishes assembling it, and goes out of the room. Then, when he returns to the room after some time, he sees that the baby cot is undone and all the parts separated, so he becomes very angry.
He is talking to his wife narrating all things during the day that went wrong, and when he comes to mentioning the baby cot, he says "...but this one takes the biscuit".