Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
选择字段时如何检索行索引gridview
gridview
GridView.FindControl("lblReqId").rowIndex;
var ctrl = GridView.FindControl("lblReqId"); var idx = GridView.Controls.IndexOf(ctrl);
RowIndex如果此控件存在于 的每个行单元格中,则无法获取GridView。您可能需要events为每一行使用该触发,在这种情况下,您可以获得 RowIndex 并最终获得您lblReqId对 that的控制Row。
RowIndex
GridView
events
lblReqId
Row