Clear ASP.Net GridView data using C# and VB.Net

Last Reply one year ago By dharmendr

Posted one year ago

how to clear gridview data using c#

You are viewing reply posted by: dharmendr one year ago.
Posted one year ago

Hi anirudhp,

To clear GridView assign null to the GridView datasource.

C#

GridView1.DataSource = null;
GridView1.DataBind();

VB.Net

GridView1.DataSource = Nothing
GridView1.DataBind()