问题补充说明:e.Row.Attributes.Add("onmouseover","c=this.style.backgroundColor;this.style.backgroundColor='#999999'");e.Row.Attributes.Add("onmouseout","this.style.backgroundColor=c");... e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#999999'"); e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c"); e.Row.Attributes.Add("onclick", "__doPostBack('GridView1','Select$" + e.Row.RowIndex + "')");//括号里写的是什么呀,是那块的知识,怎么看不懂 展开
当然可以,直接在GridView_RowDataBound事件中:protectedvoidGridView1_RowDataBound(……){if(e.Row.RowType==DataControlRowType.DataRow){e.Row.Attr仅续美ibutes.Add("onm世界冲周毫ouseover","c=this.style.backgroundColor;this.style.backgroundColor='#99序9999'");e.Ro少w.Attribute上九规段皇穿今织医六两s.Add("onmouseout","this.style.backgroundColor=c");e.Row.Attributes.Add("onclick","__doPostBack('GridView1','Select$"+e.Row.RowIndex+"')");
}}
标签:控件,GridView