我能够让它在 Gridview 上工作。最终,我试图在单击时突出显示一行。为了测试,我正在使用警报。
这是jQuery:
$(document).ready(function() {
$('#WhiteRow tr').click(function() {
event.preventDefault();
alert("white");
});
这是HTML:
<asp:Panel ID="GridViewDrillIntoCell_Panel_All"
runat="server"
width="2000px"
height="380px"
>
<asp:ListView ID="GridViewDrillIntoCell_All"
runat="server"
ScrollBars="Vertical"
ItemPlaceholderID= "myItemPlaceHolder"
UseAccessibleHeader="True"
AutoGenerateColumns="false"
HeaderStyle-CssClass="HeaderCss2"
OnSelectedIndexChanged="GV_Scorecard_Tab1_SelectedIndexChanged"
OnRowDataBound="GridViewDrillIntoCell_All_RowDataBound"
>
<LayoutTemplate>
<div id="Listview">
<table border="0" cellpadding="1">
<tr id="HeadingRow">
<th id="hcol1" style="width:50px">Client</th>
</tr>
<tr>
<asp:PlaceHolder ID="myItemPlaceHolder" runat="server">
</asp:PlaceHolder>
</tr>
</table>
</div>
</LayoutTemplate>
<ItemTemplate>
<tr id="WhiteRow">
<td id="col1" class="ListViewStyle" style="width:50px">
<%# Eval("LMClient")%>
</td>
</tr>
</AlternatingItemTemplate>
</asp:ListView></asp:Panel>