62,046
社区成员
发帖
与我相关
我的任务
分享
protected void gvEmp_RowCreated(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Attributes.Add("onmouseover", "c=this.style.backgroundColor;this.style.backgroundColor='#ccccff'");
e.Row.Attributes.Add("onmouseout", "this.style.backgroundColor=c");
e.Row.Attributes["style"] = "Cursor:hand";
e.Row.Attributes.Add("onclick", "javascript:onEmpSelected('" + txtEmpID.ClientID + "','" + e.Row.Cells[1].Text.ToString() + "','" + txtEmpName.ClientID + "','" + e.Row.Cells[2].Text.ToString() + "','" + divEmpSelect.ClientID + "');");
}
}
//试试
if(e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[0].Text.ToString();
}