Identify if attached headers exists

How do I identify if any attached headers exist?

There is no public API for such use-case, but you can get total count of header lines as
    mygrid.hdr.rows.length