c# gridview中 选定特定值的问题

来源:百度知道 编辑:UC知道 时间:2024/09/21 15:37:49
已知一个Gridview
里面有多个列
多条记录

比如其中一个列是 col1
如何点击这个列上的 具体一个记录 比如说这个记录为A
弹出新的窗口

并且这个新的窗口也是一个Gridview
这里查询显示一个与记录A 相关的一组数据

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
{//判断是否是数据行
if (e.Row.RowState == DataControlRowState.Edit)
{ // 编辑状态
//e.Row.Attributes.Remove("onclick");
e.Row.Attributes.Remove("onmouseover");
//e.Row.Attributes.Remove("ondblclick");
e.Row.Attributes.Remove("style");
e.Row.Attributes["title"] = "编辑行";
}
if (e.Row.RowType == DataControlRowType.DataRow)
{
//鼠标移动到某行上,该行变色
// e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='#ccddee'");
//鼠标移开后,恢复
//e.Row.Attributes.Add("onmouseout", "this.style.backgroundC