gridview 数据里查询出了数据现在我想删除他一行数据根据表里的ID 但是这个grideview 没有checkbox button 只是单击下选中一行,就是获取不到每行的ID,,我也设置 了datakeyNames 为 表里的ID,,我现在就想单击这行,获取ID 我从而可以删除这行数据。 比如我想获取ID的值。我用的datakeyNames 来保存这个ID 页面上只显示 序号 检测项目 检测依据 然后gridview 外面有一个删除的按钮 就是通过这个按钮来来删除,但同时也也传入ID、进来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 protected void gvTestItemList_RowDataBound(object sender, GridViewRowEventArgs e) { if (e.Row.RowType==DataControlRowType.DataRow) { e.Row.Attributes.Add("onMouseOver","SetNewColor(this);"); e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);"); e.Row.Attributes.Add("ondblclick", "SetNewColor(this);"); e.Row.Attributes["style"] = "cursor:pointer"; //这个获取 了所有的ID 不能单击一行获取这一行ID int index =Convert.ToInt32(gvTestItemList.DataKeys[e.Row.RowIndex].Value); } } 求解码base64字符 请问我这样设置的报表路径为什么不对?显示不出来呢? asp.net 寻求右导航菜单?? 在asp.net的窗口里,我点击个按钮,经过服务器运算后,希望弹出另外一个页面,怎么做? asp.net2.0中怎么调用梅花雨日历啊?急~在线等 小弟求教怎样判断是否打印成功?? <%@import namespace=system.data.ado%>出错 为何?? 类里面的错误处理?! asp.net 中什么控件能把在网页中复制的内容直接粘贴到控件中去 打印的问题 关于“FusionCharts”的奇怪现象 2.0的版本如何在VS2010打开不升级到4.0
{
if (e.Row.RowType==DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onMouseOver","SetNewColor(this);");
e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");
e.Row.Attributes.Add("ondblclick", "SetNewColor(this);");
e.Row.Attributes["style"] = "cursor:pointer";
//这个获取 了所有的ID 不能单击一行获取这一行ID
int index =Convert.ToInt32(gvTestItemList.DataKeys[e.Row.RowIndex].Value);
} }