悬赏园豆:10
[已关闭问题]
关闭于 2008-03-12 10:33
<P>我有2个gridview控件,其中一个gridview控件添加了如下代码</P>
<P> protected void gvPagePartConfig_RowDataBound(object sender, GridViewRowEventArgs e)<BR> {<BR> switch (e.Row.RowType)<BR> {<BR> case DataControlRowType.Header:<BR> e.Row.BackColor = System.Drawing.Color.White;<BR> break;<BR> case DataControlRowType.DataRow: <BR> string strID = e.Row.Cells[1].Text.Trim();<BR> if (Convert.ToInt32(ViewState["LineNo"]) == 0) //如果是奇数行<BR> {<BR> e.Row.Attributes.Add("onMouseOut", "SetOldColor(this);");<BR> e.Row.Attributes.Add("onMouseOver", "SetNewColor(this);");<BR> e.Row.Attributes.Add("onKeyOut", "SetOldColor(this);");<BR> e.Row.Attributes.Add("onKeyOver", "this.style.background='#C0C0FF'");<BR> ViewState["LineNo"] = 1;<BR> &