  We consider continued fractions with partial quotients in the ring of
integers of a quadratic number field $K$ and we prove a generalization to such
continued fractions of the classical theorem of Lagrange. A particular example
of these continued fractions is the $\beta$-continued fraction introduced by
Bernat. As a corollary of our theorem we show that for any quadratic Perron
number $\beta$, the $\beta$-continued fraction expansion of elements in
$\mathbb Q(\beta)$ is either finite of eventually periodic. The same holds for
$\beta$ being a square root of an integer. We also show that for certain 4
quadratic Perron numbers $\beta$, the $\beta$-continued fraction represents
finitely all elements of the quadratic field $\mathbb Q(\beta)$, thus answering
questions of Rosen and Bernat. Based on the validity of a conjecture of Mercat,
these are all quadratic Perron numbers with this feature.
