views:

140

answers:

1

Suppose I have three gridviews on my asp.net page.

How to select one GridView from those Gridviews in that ASP.NET page and Zebra-Stripe it using JQuery?

+2  A: 

Define css classes for the even and odd rows and use jQuery to add the classes to the tr elements:

$(document).ready(function() {
    $("#<%= myGridView.ClientID %>" tbody tr:even).addClass("even");
    $("#<%= myGridView.ClientID %>" tbody tr:odd).addClass("odd");
}
Jamie Ide