最新国产好看的视频,伊人天堂AV在线,国产Aaaaaa视频,蜜臀视频在线观看一区,人妻av色图,密臀久久久精品影片,青青视频免费观看毛片,久草在线观看视,国产三级精品色情在线

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中有無控件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)論

哈密市| 建昌县| 尼勒克县| 晋宁县| 武汉市| 北流市| 墨脱县| 清水县| 汤阴县| 桃园县| 芜湖市| 涪陵区| 米林县| 广河县| 河北区| 鸡泽县| 来安县| 合山市| 深圳市| 青海省| 潜江市| 枣阳市| 大田县| 夏邑县| 茶陵县| 来凤县| 图木舒克市| 巴南区| 双峰县| 宣城市| 杭锦旗| 庆城县| 乳山市| 克什克腾旗| 泾川县| 务川| 宜城市| 宜州市| 东阿县| 弥渡县| 长沙县|