DataList Gridview 数据绑定过滤 及鼠标移动样式

来源:互联网 发布:淘宝上的全球购可信吗 编辑:程序博客网 时间:2024/05/18 01:56

<%# DataBinder.Eval(Container.DataItem,"Title").ToString().Length>12?DataBinder.Eval(Container.DataItem,"Title").ToString().Substring(0,10)+"...":DataBinder.Eval(Container.DataItem,"Title").ToString()%>

 

 

 

 

 

 

 

            //判断是否是DataRow,以防止鼠标经过Header也有效果 
            if (e.Row.RowType == DataControlRowType.DataRow)
            {
                e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor; this.style.backgroundColor='#c8dafa';this.style.cursor='pointer';");
                e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c;");
                //整行可选
                //e.Row.Attributes.Add("onclick", "__doPostBack('" + gv_PermissionsSelect.UniqueID + "','Select$" + e.Row.RowIndex + "');");
                //删除键在最后一列
                e.Row.Cells[e.Row.Cells.Count - 1].Attributes.Add("onclick", "DeleteConfirm(event)");
            }

原创粉丝点击