  Let $F$ be an infinite field and $UT(d_1,\dots, d_n)$ be the algebra of upper
block-triangular matrices over $F$. In this paper we describe a basis for the
$G$-graded polynomial identities of $UT(d_1,\dots, d_n)$, with an elementary
grading induced by an $n$-tuple of elements of a group $G$ such that the
neutral component corresponds to the diagonal of $UT(d_1,\dots,d_n)$. In
particular, we prove that the monomial identities of such algebra follow from
the ones of degree up to $2n-1$. Our results generalize for infinite fields of
arbitrary characteristic, previous results in the literature which were
obtained for fields of characteristic zero and for particular $G$-gradings. In
the characteristic zero case we also generalize results for the algebra
$UT(d_1,\dots, d_n)\otimes C$ with a tensor product grading, where $C$ is a
color commutative algebra generating the variety of all color commutative
algebras.
