[英]How to dynamically retrieve the column index, id and the row index of a row in gridview
[英]How to retrieve row index in gridview
在gridview
選擇領域時如何檢索行索引
GridView.FindControl("lblReqId").rowIndex;
var ctrl = GridView.FindControl("lblReqId");
var idx = GridView.Controls.IndexOf(ctrl);
如果GridView
每個行單元格中都存在此控件,則無法獲取RowIndex
。 您可能需要使用為每一行觸發的events
,在這些事件中,您可以獲取RowIndex並最終引用該Row
獲得控件lblReqId
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.