Reputation: 3896
I know how to set up listview to highlight a row when you click a link, image, etc but I am just wondering if it is possible to set it up to highlight a row when you click on any of its cells, not just on a predefined control.
Is that possible?
I way around it would be to setup onclick of each <td>
but no idea how to reset the background colour when you click on another cell.
Upvotes: 0
Views: 2100
Reputation: 38087
You could use Jquery on the client side:
$("#myTable tr").click( function ()
{
$("#myTable tr").each(function () { $(this).removeClass("selected")});
$(this).addClass("selected");
});
An example fiddle:
Upvotes: 4