ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子!11

本文提供了一个ASP.NET 2.0环境下使用GridView控件进行数据展示、编辑及删除操作的完整示例代码。通过为GridView中的每一行添加hover效果和点击时背景色变化的功能,增强了用户体验。

ASP.NET2.0下含有DropDownList的GridView编辑、删除的完整例子!

日期:2007年8月17日 作者: 查看:[ 大字体 中字体 小字体]

  • 添加到QQ书签收藏 添加到雅虎收藏 添加到百度收藏 添加到Google书签 添加到Yahoo书签 添加到新浪ViVi 添加到搜狐网摘 添加到365Key网摘 添加到天极网摘 添加到diglog 添加到和讯网摘 添加到POCO网摘 添加到YouNote网摘 添加到博拉网 添加到天下图摘 Del.icio.us digg reddit spurl BlinkList blogmarks

    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';");
            }
        } 
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值