7

I have a web form that uses the Telerik RadAjaxManager (via RadAjaxManager proxy) to update a RadGrid based on filter criteria. When the criteria change, I rebind the grid, but now I also want to resize the grid on the client, using JavaScript. How can I cause my JavaScript to be executed when I rebind the grid? The JS code already exists on the page, and just needs to be called.

E.g. When I increase the number of rows in the RadGrid, it reverts to a default height, much less that the height of its container, until I resize or reload the page, when the grid is sized by the code below. I want to be able to execute resizeChildren() when my criteria, and thus the number of rows, changes.

    function resizeChildren() {
        $("#ctl00_mainContentPlaceHolder_grid_GridData").height($(window).height() - 160);
    }

    $(document).ready(function() {
        resizeChildren();
    });
    $(window).resize(function() {
        resizeChildren();
    });

I know I can do this with client side code altogether, but I want to know how to execute client side code as part of the response to an Ajax callback.

1
  • There is now code and more explanation. Commented Nov 27, 2009 at 15:49

2 Answers 2

4

I know this has already been answered but I wanted to chime in...

If you add a RadScriptBlock inside of a RadAjaxPanel then it will be executed whenever a contained object causes the ajax-postback

Sign up to request clarification or add additional context in comments.

Comments

3

What I would do is either using the response scripts collection of RadAjaxManager or the pageLoaded handler of the PageRequestManager. See this article on the Telerik site for details.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.