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

  • 相关阅读:
    架设WCF项目出现的问题
    百思不得其解的"Failed to allocate a managed memory buffer of 268435456 bytes."错误解决
    Ajax 分页
    关于Asp.net调用外部程序的拒绝访问错误
    转贴:[翻译]Visual Studio 2008 Code Metrics
    荀子,劝学篇(部分)
    .net设计模式(转载)
    人月神话读书笔记
    Memory food
    2010年4月12日,今天做计划
  • 原文地址:https://www.cnblogs.com/leiyu1905/p/14909809.html
Copyright © 2011-2022 走看看