  Inspired by the notion of K\"onig graphs we introduce graded ideals of
K\"onig type with respect to a monomial order $<$. It is shown that if $I$ is
of K\"onig type, then the Cohen--Macaulay property of $\ini_<(I)$ does not
depend on the characteristic of the base field. This happens to be the case
also for $I$ itself when $I$ is a binomial edge ideal. Attached to an ideal of
K\"onig type is a sequence of linear forms, whose elements are variables or
differences of variables. This sequence is a system of parameters for
$\ini_<(I)$, and is a potential system of parameters for $I$ itself. We study
in detail the ideals of K\"onig type among the edge ideals, binomial edge
ideals and the toric ideal of a Hibi ring and use the K\"onig property to
determine explicitly their canonical module.
