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的开发

  • 相关阅读:
    vim/gvim使用笔记
    WebStorm for Mac (PyCharm)- 破解注册激活版下载
    volatile 关键字
    vue页面在加载的时候闪烁花括号{{}} 解决非工程化项目初始化页面闪动问题
    Element-ui el-table表格 排序图标刷新后不见问题
    与运算(&)、或运算(|)、异或运算(^)
    JS中 二进制与十进制的相互转换
    报告大家好消息,我找到新工作了
    公众号基本配置 token 验证失败,成功解决
    asp.net core 5.0,怎么山寨了koa2?
  • 原文地址:https://www.cnblogs.com/leiyu1905/p/14909809.html
Copyright © 2011-2022 走看看