GridView
will only display if there's data associated on it. Have you binded your
GridView
on
Page_Load
event? If you did, then make sure that you wrap your code within !
IsPosBack
block:
protected void Page_Load(object sender, EventArgs e)
{
if(!IsPostBack){
}
}
If you want to force your
GridView
to clear the data and hide it, then you can set the datasource to nothing like this:
GV1.DataSource = null;
Gv1.DataBind();