3
的onmouseover手形圖標我有一個GridView:沒有顯示
<asp:GridView ID="gvwProd" runat="server" CssClass="gridview" ShowHeaderWhenEmpty="true"
AllowPaging="true" BackColor="ButtonFace" OnRowDataBound="gvwProd_OnRowDataBound"
OnRowCreated="gvwProd_RowCreated" OnSorting="gvw_OnSorting" AllowSorting="true"
AutoGenerateColumns="false" ShowFooter="false">
我想設置一個手懸停圖標上每行一個特定的細胞:
protected void gvwProd_OnRowDataBound(object sender, GridViewRowEventArgs e)
{
if (e.Row.RowType == DataControlRowType.DataRow)
{
e.Row.Cells[2].Attributes.Add("onmouseover", "document.body.style.cursor='hand'");
e.Row.Cells[2].Attributes.Add("onmouseout", "document.body.style.cursor='auto'");
}
}
的onmousover和onmouseout事件出現在標記中:
<td onmouseover="document.body.style.cursor='hand'" onmouseout="document.body.style.cursor='auto'" style="white-space:nowrap;">05-07-2012</td>
但是,沒有可見的手跡,也沒有看到發生任何事情。我究竟做錯了什麼?使用IE 8
工作完美! – Ted 2012-07-27 17:46:21