您的位置:首页 > 其它

GridView双击回传父页面及改变选择行颜色

2008-01-25 16:53 281 查看
父页面(略)

其中window.showModalDialog中第二个参数可以将父页面对象传给子页面

子页面


protected void GridView1_RowCreated(object sender, GridViewRowEventArgs e)




...{


if (e.Row.RowType == DataControlRowType.DataRow)




...{


e.Row.Attributes.Add("onmouseover","color = this.style.backgroundColor;this.style.backgroundColor='#0000ff';this.style.cursor='hand'");


e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=color");


}


}




protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)




...{


if (e.Row.RowType == DataControlRowType.DataRow)




...{


e.Row.Attributes.Add("ondblClick ", "GetKey('" + e.Row.Cells[0].Text + "')");


}


}




function GetKet(text)




...{


//window.open


window.opener.document.getElementById("txt11").value = text;


//showModelDialog


var control = window.dialogArguments;


control.value = text;


}

很简单!
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: