C# – GridView to refresh when button click updates data

asp.netcdata-binding

I have a button click event on a page which ultimate updates a table using:

protected void Button2_Click(object sender, EventArgs e)
{
    this.AccessDataSource6.Insert();
}

A GridView bound to a different AccessDataSource, displays data that is updated by the Insert.

What do I need to include in Button2_Click for the GridView to be refreshed?

Best Answer

The GridView.DataBind Method will clear and re-populate your grid view (assuming the datasource is already set - see the link for an example).

Related Topic