1
protected void GridView1_PageIndexChanging(object sender, GridViewPageEventArgs e)
2
{
3
GridView1.PageIndex = e.NewPageIndex;
4
GridView1.DataBind();
5
}
6
}
GridView的基本操作:选择 事件:SelectedIndexChanging

2

3

4

5

6

1
protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
2
{
3
TextBox3.Text = GridView1.Rows[e.NewSelectedIndex].Cells[0].Text;
4
TextBox4.Text = GridView1.Rows[e.NewSelectedIndex].Cells[1].Text;
5
TextBox2.Text=GridView1.Rows[e.NewSelectedIndex].Cells[2].Text;
6
CachePic=GridView1.Rows[e.NewSelectedIndex].Cells[3].Text;
7
CacheSort = GridView1.Rows[e.NewSelectedIndex].Cells[4].Text;
8
}//这里不需要重新绑定

2

3

4

5

6

7

8
