zoukankan      html  css  js  c++  java
  • 每日日报2021.3.26

    今天完成内容:

    学习andriod

     7.鼠标移到GridView某一行时改变该行的背景色方法二:

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //int i;
            ////执行循环,保证每条数据都可以更新
            //for (i = 0; i < GridView1.Rows.Count; i++)
            //{
            //    //首先判断是否是数据行
            //    if (e.Row.RowType == DataControlRowType.DataRow)
            //    {
            //        //当鼠标停留时更改背景色
            //        e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#00A9FF'");
            //        //当鼠标移开时还原背景色
            //        e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
            //    }
            //}
            //如果是绑定数据行 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                //鼠标经过时,行背景色变 
                e.Row.Attributes.Add("onmouseover", "this.style.backgroundColor='#E6F5FA'");
                //鼠标移出时,行背景色变 
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor='#FFFFFF'");
            }

        }

    8.GridView实现删除时弹出确认对话框:

    实现方法:
    双击GridView的OnRowDataBound事件;
    在后台的GridView1_RowDataBound()方法添加代码

    protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
            //如果是绑定数据行 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                 if (e.Row.RowState == DataControlRowState.Normal || e.Row.RowState == DataControlRowState.Alternate)
                {
                    ((LinkButton)e.Row.Cells[6].Controls[0]).Attributes.Add("onclick", "javascript:return confirm('你确认要删除:"" + e.Row.Cells[1].Text + ""吗?')");
                }
            } 

        }

    看视频

    遇到问题:

    明日目标:

    学习Android studio的开发

  • 相关阅读:
    使用C#替换Word文档里的文字和图片
    《程序员的思维修炼—开发认知潜能的九堂课》—从新手到专家的历程
    从已有数据库表生成Insert语句的小工具
    我的2010
    Sqlite批量插入速度慢的解决方法小计
    分享一个winForm下的Chart控件
    分享一个任务提醒小工具
    SpringBoot+Vue+Echarts实现选择时间范围内数据加载显示柱状图
    Winform中选取指定文件夹并获取其下所有文件
    Vue中JS遍历后台JAVA返回的Map数据,构造对象数组数据格式
  • 原文地址:https://www.cnblogs.com/leiyu1905/p/14909809.html
Copyright © 2011-2022 走看看