Tuesday, April 15, 2008

How to Clear GridView Quickly

If you need to completely clear a GridView quickly, write the following code:
protected void ClearGrid(GridView gv)
{
    gv.DataSource = null;
    gv.DataSourceID = null;
    gv.DataBind();
}

No comments:

Post a Comment