Skip to content Skip to sidebar Skip to footer

Nested Grid Does Not Stay Expanded After Insertion But Not After Pageindexchanging Event

I have a nested grid staying in the expanded state after an insertion. I thought I could just apply the same logic in the PageIndexChanging event and it would work there also. Bu

Solution 1:

I got my nested grid to remain expanded after paging. This is how I fixed it... First, I removed Sys.WebForms.PageRequestManager.getInstance().add_endRequest from the javascript so that the function looked like this:

functionExpandGrid(groupID) {
        var div = document.getElementById(groupID);
        alert("groupID: " + groupID + " div: " + div);
        var img = document.getElementById('img' + groupID);
        div.style.display = "inline";
        img.src = "Images/minus.png";
        $(div + ".chosen-single").chosen("destroy");
        $(div + ".chosen-single").chosen({
            search_contains: true,
            width: "100%",
            no_results_text: "Sorry, no match!"
        });

Then within the PageIndexChanged I correctly named the parameter and surrounded it in single quotes:

string strJavascriptFnCall = "ExpandGrid('div" + tiGroupID.ToString() + "')";

Finally, I put the UpdatePanel outside the div, not inside it as shown above.

That got it to work. I hope this can help someone.

Post a Comment for "Nested Grid Does Not Stay Expanded After Insertion But Not After Pageindexchanging Event"