Implementing a method to prevent grid-border clicks