protected void GridView1_SelectedIndexChanging(object sender, GridViewSelectEventArgs e)
{
GridView1.Rows[e.NewSelectedIndex].Attributes.Add("onclick", "OnFocus( '#000000','#FFFFFF','#FFFFFF','#bcbcbc' );");
}这个为什么不行?不用SelectedIndexChanging这个事件么?
{
GridView1.Rows[e.NewSelectedIndex].Attributes.Add("onclick", "OnFocus( '#000000','#FFFFFF','#FFFFFF','#bcbcbc' );");
}这个为什么不行?不用SelectedIndexChanging这个事件么?
解决方案 »
- 大家是如何做服务器上的文件更新和管理的
- 模态窗口的(!ispostback)无法进入
- 如何在2页面间传递多个值??
- gridview如何显示两个行数不同的数据库信息
- asp.net新人求住
- asp.net项目中包括一个HTM页面,全站的的样式表是采用<LINK href='<%=Session["css"]%>' type="text/css" rel="stylesheet">指定的,ASP
- 关于asp.net 2.0 QuickStart Tutorial下载
- 紧急向高手请教,有关asp.net UBB 使用??
- ToolTip 可以支持html显示吗?
- 如何在Webform中添加ListView控件?
- 打开vs2005新建项目和新建网站出现的是一样的 就是没法新建网站,不知是什么原因
- 网页中的table 的height=100%无效,
{
if (e.Item.ItemType == ListItemType.Item || e.Item.ItemType == ListItemType.AlternatingItem)
{
//颜色交替
e.Item.Attributes.Add("onmouseover","this.style.backgroundColor='Gainsboro'");
if(e.Item.ItemType == ListItemType.Item)
{
e.Item.BackColor=System.Drawing.Color.LightCyan;
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='LightCyan'");
} if(e.Item.ItemType ==ListItemType.AlternatingItem)
{
e.Item.BackColor=System.Drawing.Color.White;
e.Item.Attributes.Add("onmouseout", "this.style.backgroundColor='White'");
}
}
}
{
this.dg.ItemDataBound += new System.Web.UI.WebControls.DataGridItemEventHandler(this.dg_ItemDataBound1);}
//GV_Brand行加载事件
protected void GV_Brand_RowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#E6E6FA'");
//当鼠标移开时还原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
//鼠标双击事件
e.Row.Attributes.Add("ondblclick", "self.location='Brand_Register.aspx?CNID="
+ GV_Brand.DataKeys[e.Row.RowIndex].Value.ToString() + "'"); RadioButton rb = (RadioButton)e.Row.FindControl("rd_sort");
rb.Attributes.Add("onclick", "judge(this)");
}
}
#endregion
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "bcl=this.style.backgroundColor;this.style.backgroundColor='#00ffee'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=bcl;");
}
}
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
//当鼠标停留时更改背景色
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#E6E6FA'");
//当鼠标移开时还原背景色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
//鼠标双击事件
e.Row.Attributes.Add("ondblclick", "self.location='Brand_Register.aspx?CNID="
+ GV_Brand.DataKeys[e.Row.RowIndex].Value.ToString() + "'"); RadioButton rb = (RadioButton)e.Row.FindControl("rd_sort");
rb.Attributes.Add("onclick", "judge(this)");
}
}