ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子!
日期:2007年8月17日 作者: 查看:[ 大字体 中字体 小字体]-
border="0" marginwidth="0" marginheight="0" src="http://www.hackhome.com/gg/web/ff_468.html" frameborder="no" width="468" scrolling="no" height="0"> - <script src="http://pagead2.googlesyndication.com/pagead/show_ads.js" type="text/javascript"> </script> name="google_ads_frame" marginwidth="0" marginheight="0" src="http://pagead2.googlesyndication.com/pagead/ads?client=ca-pub-0692289505803928&dt=1206923820187&lmt=1199974375&format=300x250_as&output=html&correlator=1206923820187&channel=6926205886&url=http%3A%2F%2Fwww.hackhome.com%2FInfoView%2FArticle_36552_11.html&color_bg=FFFFFF&color_text=000000&color_link=000060&color_url=008000&color_border=FFFFFF&ad_type=text_image&ref=http%3A%2F%2Fwww.hackhome.com%2FInfoView%2FArticle_36552_10.html&frm=0&cc=100&ga_vid=1412675807.1206923820&ga_sid=1206923820&ga_hid=1846230945&flash=9.0.47.0&u_h=768&u_w=1024&u_ah=738&u_aw=1024&u_cd=32&u_tz=480&u_his=10&u_java=true" frameborder="0" width="300" scrolling="no" height="250" allowtransparency="allowtransparency"> if (e.Row.RowType == DataControlRowType.DataRow)//判定当前的行是否属于datarow类型的行
{
//当鼠标放上去的时候 先保存当前行的背景颜色 并给附一颜色
e.Row.Attributes.Add("onmouseover", "currentcolor=this.style.backgroundColor;this.style.backgroundColor='yellow',this.style.fontWeight='';");
//当鼠标离开的时候 将背景颜色还原的以前的颜色
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=currentcolor,this.style.fontWeight='';");
}
//单击行改变行背景颜色
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onclick", "this.style.backgroundColor='#99cc00'; this.style.color='buttontext';this.style.cursor='default';");
}
}