Clearing a populated GridView control can be done in just 3 lines of code. Create an empty DataTable and then bind it to the Gridview.
DataTable dt = new DataTable();
GridView1.DataSource = dt;
GridView1.DataBind();
Clearing a populated GridView control can be done in just 3 lines of code. Create an empty DataTable and then bind it to the Gridview.
DataTable dt = new DataTable();
GridView1.DataSource = dt;
GridView1.DataBind();
GridView1.DataSource = null;
GridView1.DataBind();