I was able to get this to work on a Gridview.
Ultimately I am trying to highlight a row when clicked.
For testing I am using an alert.
Here is the jQuery:
$(document).ready(function() {
$('#WhiteRow tr').click(function() {
event.preventDefault();
alert("white");
});
Here is the 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>
I think your selector is incorrect.
#WhiteRow trmeans select all thetrelements that are within an element with the id ofWhiteRow. So you are looking for rows within rows.