add a method to GridView for testing and test class