Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

GridView to refresh when button click updates data

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?

like image 946
Degan Avatar asked Nov 21 '09 15:11

Degan


1 Answers

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

like image 169
JohnIdol Avatar answered Sep 29 '22 08:09

JohnIdol