解决方法如下:
给GridView控件添加一个事件PageIndexChanging,并设置GridView的属性:AllowPaging="True"
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
GridView1.PageIndex = e.NewPageIndex;
GridView1.datasource="数据源"; GridView1.DataBind();
}