I'm following a example by Matt Berseth on Master Detail using Thickbox where the thickbox will refresh the UpdatePanel of the calling page to reflect changes done of the thickbox. My GridView in the calling page is a fixed header gridview and to maintain the scroll position of the gridview, I use the following code. The problem now is that the whole page refreshes after the thickbox closes.
var xPos, yPos;
var prm = Sys.WebForms.PageRequestManager.getInstance();
prm.add_beginRequest(BeginRequestHandler);
prm.add_endRequest(EndRequestHandler);
function BeginRequestHandler(sender, args) {
xPos = $get('divGrid').scrollLeft;
yPos = $get('divGrid').scrollTop;
}
function EndRequestHandler(sender, args) {
$get('divGrid').scrollLeft = xPos;
$get('divGrid').scrollTop = yPos;
}
If I take the above script out, then it works fine, the update panel would refresh and not the whole page, but of course the scroll position of the GridView is lost. Is there a way so that the page won't refresh and still maintain scroll position?
Hope someone can help me with this.
Thanks, Ronald