(a) No person shall obtain or attempt to obtain from a child a written or recorded statement or affidavit setting forth the wishes and concerns of the child regarding grandparent visitation matters, and the court, in considering the factors listed in section 10-502 of this article for purposes of determining whether to grant any visitation, establishing a visitation schedule, or resolving any issues related to the making of any determination with respect to visitation or the establishment of any specific visitation schedule, shall not accept or consider such a written or recorded statement or affidavit.
(b) A child shall not be called as a witness in any proceeding to determine whether grandparent visitation should be awarded.
If a motion for grandparent visitation is filed in a pending action for divorce, custody, legal separation, annulment or establishment of paternity pursuant to section 21-401, the grandparent shall be granted visitation if a preponderance of the evidence shows that visitation is in the best interest of the child and that:
(1) The party to the divorce through which the grandparent is related to the minor child has failed to answer or otherwise appear and defend the cause of action; or
(2) The whereabouts of the party through which the grandparent is related to the minor child are unknown to the party bringing the action and to the grandparent who filed the motion for visitation.