private void dgPNotice_ItemDataBound(object sender, System.Web.UI.WebControls.DataGridItemEventArgs e)
{
//为数据项添加鼠标单击属性
for(int i = 1; i<=9; i++)
e.Item.Cells[i].Attributes.Add("onclick", " window.open('ViewPNotice.aspx?id="+e.Item.Cells[1].Text+"','','left=200px,top=100px,width=800px,height=600px,scrollbars=yes,resizable=yes' ) ");
}
如何使鼠标在移到每行数据的时候变成手型?我只知道style.cursor ="hand";在DataGrid中不知道如何设置?谢谢啦!!
{
//为数据项添加鼠标单击属性
for(int i = 1; i<=9; i++)
e.Item.Cells[i].Attributes.Add("onclick", " window.open('ViewPNotice.aspx?id="+e.Item.Cells[1].Text+"','','left=200px,top=100px,width=800px,height=600px,scrollbars=yes,resizable=yes' ) ");
}
如何使鼠标在移到每行数据的时候变成手型?我只知道style.cursor ="hand";在DataGrid中不知道如何设置?谢谢啦!!
onMouseOver="style.cursor ='hand'"
试试
{
e.Item.Attributes["onmouseout"] = "javascript:this.style.backgroundColor=’#FFFFFF’;";
e.Item.Attributes["onmouseover"] = "javascript:this.style.backgroundColor=’#d9ece1’;cursor=’hand’;" ;
}
{
e.Item.Attributes.Add("onclick","this.style.cursor='hand';");
}