gridview在RowDataBound事件中怎样获取行关键字

2024-12-18 15:40:17
推荐回答(1个)
回答1:

超出索引范围了 加上范围
if (e.RowType == DataControlRowType.DataRow)
{
this.GridView1.DataKeys[e.Row.RowIndex].Values;
}

保证只有当该行为数据行才执行