1
protected
void
GridView1_PageIndexChanging(
object
sender, GridViewPageEventArgs e)
2![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
3
GridView1.PageIndex = e.NewPageIndex;
4
GridView1.DataBind();
5
}
6
}
GridView的基本操作:选择 事件:
SelectedIndexChanging
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
1
protected
void
GridView1_SelectedIndexChanging(
object
sender, GridViewSelectEventArgs e)
2![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
{
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
}
//
这里不需要重新绑定
![](https://www.cnblogs.com/Images/OutliningIndicators/None.gif)
2
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockStart.gif)
![](https://www.cnblogs.com/Images/OutliningIndicators/ContractedBlock.gif)
![](https://www.cnblogs.com/Images/dot.gif)
3
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
4
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
5
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
6
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
7
![](https://www.cnblogs.com/Images/OutliningIndicators/InBlock.gif)
8
![](https://www.cnblogs.com/Images/OutliningIndicators/ExpandedBlockEnd.gif)