欧美bbbwbbbw肥妇,免费乱码人妻系列日韩,一级黄片

asp.net獲得數(shù)據(jù)控件事件索引并獲取其中值總結(jié)

 更新時(shí)間:2011年11月02日 11:45:21   作者:  
asp.net獲得數(shù)據(jù)控件事件索引并獲取其中值總結(jié),需要的朋友可以參考下。
復(fù)制代碼 代碼如下:

1、RowCommad
//獲得索引
int index = ((GridViewRow)(((Button)(e.CommandSource)).Parent.Parent)).RowIndex;

2、RowEditing等
//獲得索引
int index = e.NewEditIndex;
//獲取當(dāng)前GridViewRow對(duì)象
GridViewRow editGridViewRow = autoGridView.Rows[girdviewEditIndex];

//獲取內(nèi)容方法一 row中有控件Label
Label girdviewTitleLabel = editGridViewRow.Cells[0].FindControl("titleLabel") as Label;
string gridViewContent = girdviewTitleLabel.Text;
//獲取內(nèi)容方法二 row中有無(wú)控件Label
//string gridViewContent = editGridViewRow.Cells[0].Text;

3、RowDeleting等
//獲得索引
int index=e.RowIndex ;
//獲取當(dāng)前GridViewRow對(duì)象
GridViewRow gvr=autoGridView.Rows[index];
//取得當(dāng)前行第二個(gè)單元格中的文字
string str = gvr.Cells[1].Text;

相關(guān)文章

最新評(píng)論