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;
}
很简单!
其中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;
}
很简单!
相关文章推荐
- GridView 单击选择行,双击打开详细页面,鼠标移到某行上变色
- GridView 单击选择行,双击打开详细页面,鼠标移到某行上变色
- GridView 单击选择行,双击打开详细页面,鼠标移到某行上变色
- 模板列中CheckBox改变GridView行的颜色(2) (.cs页面实现)
- 改变页面选择文字颜色和背景颜色----selection伪元素
- CheckBox改变GridView行的颜色(转载)
- 鼠标停留在GridView某一行时,行的颜色改变
- [原创]扩展GridView实现多选(全选)、点击行任意位置选择行、选中变色、添加双击事件等
- RadioGroup 的 RadioButton 选择改变字体颜色和背景颜色
- GridView改变行的颜色(二)
- gridview repeater DataList 鼠标经过改变背景颜色
- GridView中点击CheckBox选中一行来改变此行的颜色
- 用JavaScript页面不刷新时全选择,全删除(GridView)
- Excel中,通过 「条件格式」 实现, 下拉菜单选择某个值时,这一行的颜色改变。
- asp.net 如何改变GridView搜索出来关键字的颜色?就像百度似的,我获得的是一个集合,改变集合中关键字的集合
- GridView扩展鼠标经过改变行的颜色
- 鼠标停留在GridView某一行时行的颜色改变
- [置顶] H5页面在iOS网页中的数字被识别为电话号码(数字颜色自动被改变成蓝色)?
- 通用弹出页面,双击行选择设计
- RadioGroup 的 RadioButton 选择改变字体颜色和背景颜色