Click here to Skip to main content
14,865,522 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
I have a parent gridview. In that, I have multiple nested gridviews. In each nested gridview I have column in which a header checkbox and child checkboxes are present. If I check one nested gridview's header checkbox and again checked another nested gridview's header checkbox then first gridview's checkboxes does not maintain its checked status. They become unchecked including header checkbox.

I am using the following code


<pre>$(document).ready(function () {

        $("#<%=grdParent.ClientID %>").each(function () {
            alert("Hi");
            $(this).find(".grdchild > tbody > tr").each(function () {
                $(this).find('input:checkbox[id*="chkHeader"]').click(function () {
                    var isChecked = $(this).prop("checked");
                    $(this).closest("tr").find("[id*=chkChild]:checkbox").prop('checked', isChecked);
                    //$("[id*=chkChild]:checkbox").prop('checked', isChecked);
                });
                //Do Stuff
            });
        });
    });
Posted
Comments
Peter Leow 17-Jan-15 7:18am
   
Show the GridView code?
   
Debug and see what is exactly happening when you check one GridView's header checkbox.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900