.net中的Gridview 不点击编辑按钮后也可以编辑数据
2个回答
展开全部
那就双击这行进行编辑。。。
LinkButton lbEdit = e.Row.FindControl("lbEdit") as LinkButton;
if (lbEdit != null)
{
e.Row.Attributes["ondblclick"] = String.Format("javascript:document.getElementById('{0}').click();", lbEdit.ClientID);
e.Row.Attributes["style"] = "cursor:pointer";
e.Row.Attributes["title"] = "双击编辑当前行";
}
break;
LinkButton lbEdit = e.Row.FindControl("lbEdit") as LinkButton;
if (lbEdit != null)
{
e.Row.Attributes["ondblclick"] = String.Format("javascript:document.getElementById('{0}').click();", lbEdit.ClientID);
e.Row.Attributes["style"] = "cursor:pointer";
e.Row.Attributes["title"] = "双击编辑当前行";
}
break;
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询