Setting the Visible/Display property will only hide the Grid. If you want to remove the Grid completely from the page it is better to delete the Grid from the design page. You may also try with the following code snippet to remove the control in the code behind.