What does this error mean in the context of a GridView?
It is an error to use a section registered as allowDefinition=’MachineToApplication’ beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS.
It is unlikely that this error has anything to do with your Gridview control. It is more likely that, as the message suggests, you have not configured the virtual directory for your website as an application in IIS. Right-click the website in IIS and check its properties.