我有一个网格视图:
<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