为gridview的每个单元格添加鼠标悬停提示文本(tooltip)

protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
    {
        for (int i = 0; i < e.Row.Cells.Count; i++)//获取总列数
        {
            //如果是数据行则添加title
            if (e.Row.RowType ==DataControlRowType.DataRow )
            {//设置title为gridview的head的text
                e.Row.Cells[i].Attributes.Add("title", e.Row.Cells[i].Text);
            }

}
    }

上一篇:Redis Java API


下一篇:hibernate Validator 6.X 的学习,bean的约束(字段,get方法上的验证)