62,074
社区成员
发帖
与我相关
我的任务
分享
protected void DropDownList1_SelectedIndexChanged(object sender, EventArgs e)
{
DropDownList drop = sender as DropDownList;
//找到行索引
int index = (drop.NamingContainer as GridViewRow).RowIndex;
//得到主键值,GridView要设置DataKeyNames属性
string id = GridView1.DataKeys[index].Value.ToString();
}