Hi Aravindba,
I have implemented the same in my project once, It reminds me once you asked this question,
will paste my code for you here so that you can make use of it in your code.
container.find("#btn_CollapseAllPennyTests").unbind("click").click(function () {
$(".odd").closest("tr").hide();
$(".even").closest("tr").hide();
});
container.find("#btn_ExpandAllPennyTests").unbind("click").click(function () {
$(".odd").closest("tr").show();
$(".even").closest("tr").show();
});
I hope this would help you.