AutoResize after failed validation

3 posts, 0 answers
  1. Neil
    Neil avatar
    50 posts
    Member since:
    Mar 2009

    Posted 23 Mar 2011 Link to this post

    I noticed that after I submit a form that fails validation, my window (with autosize="true" set) does not auto-resize to account for the validation summary.

    In my click event, I am trying to call autoSize() directly if IsValid id false without much success.  

    private void Save_Click(object sender, EventArgs e)
                if (this.IsValid)
                        // save
                        string autoSize = "getRadWindow().autoSize(true);";
                        // Register a startup script which will manually call autoSize() on radWindowActivity

  2. Svetlina Anati
    Svetlina Anati avatar
    2795 posts

    Posted 28 Mar 2011 Link to this post

    Hello Neil,

    The provided information is not enough to completely understand the setup and the problem.

    One possible reason for such a problem is that the controls in the RadControls for ASP.NET AJAX suite are built upon the MS AJAX framework and the framework itself creates its controls (including RadWindow) in the Sys.Application.add_init() method.

    Here is how the client events are fired in the page life cycle:

    window.onload -> Sys.Application.init -> Sys.Application.load

    You can see that the client object representation of MS AJAX controls are created just as the last code on the page in the Sys.Application.init event, which is raised after the window.onload event.

    That is why when you call your code in window.onload by registering the client script, the RadWindow will still not be created on the page and you will get an error. To avoid this problem, you can either execute your code with a small timeout, or use the Sys.Application.add_load method.

    You can find additional information about this here:

    In case you need further assistance, please prepare a fully runnable simple reproduction demo along with detailed reproduction instructions, open a new support ticket and send it to us and we will modify it in order to meet your requirements so that you will be then able to apply the same logic in your original application.

    Kind regards,
    the Telerik team
  3. Neil
    Neil avatar
    50 posts
    Member since:
    Mar 2009

    Posted 05 Apr 2011 Link to this post

    Thanks Svetlina , that got me in the right direction.

Back to Top