0
$('#<%= gr.ClientID%>tr').click(function() {
$(this).addClass('highlightCell');
}, function() {
$(this).removeClass('highlightCell');
});
});
<asp:GridView ID="gr" runat="server" DataKeyNames="Name" AutoGenerateColumns="false">
的鼠标悬停此代码的工作,但不能点击鼠标。
请帮帮我。
在此先感谢如何在asp.net中点击鼠标点击gridview单元格?
代码看起来像你改变表格行颜色点击。它不工作?可能你需要'$('#<%= gr.ClientID%> td')'而不是 – Grundy
这是jQuery'.click'事件的错误语法。你可以只有一个处理程序内点击 –
使用此链接:http://stackoverflow.com/questions/16543683/vb-net-mouse-click-single-cell-of-gridview-change-backcolor-and-output- cell-pos –