从GridView中删除

时间:2015-08-11 13:26:17

标签: c# asp.net

我是ASP.net的初学者,C#。我希望删除在GridView帮助下返回的报告中的行。具体代码的开头是:

Label Lblno = (Label)Gridview1.Rows[e.RowIndex].FindControl("Lblno") 

这条线是什么意思?请解释一下:

(Label)Gridview1.Rows[e.RowIndex].FindControl("Lblno")

我无法获得此特定行的代码流。我不知道它是什么。

e.RowIndex,FindControl("Lblno")

1 个答案:

答案 0 :(得分:0)

Lblno是一个标签名称,位于GridCell

e.RowIndex是当前Row的索引,单击/选择。

FindControl()是找到放置在GridRow

中的控件

(Label)Gridview1.Rows[e.RowIndex].FindControl("Lblno")表示从(Lblnoe.RowIndex的行索引中找到名为GridView1的控件,并且该控件是Label的类型

相关问题