Opening a window in Form_Creating

3 posts, 1 answers
  1. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 09 Nov 2010 Link to this post

    I'm working on a Scheduler page that opens the add/edit form in a RadWindow. I based the idea on the External Edit in RadDock demo.

    I have a question though.

    I'm opening my RadWindow using code very like this from the demo...
    ScriptManager.RegisterStartupScript(Page, GetType(), "formScript", "Sys.Application.add_load(openForm);", true);

    I'd be interested to learn why this works when this ...
    RadAjaxManager LocalManager = RadAjaxManager.GetCurrent(Page);
    LocalManager.ResponseScripts.Add("OpenForm();");

    doesn't.

    -- 
    Stuart

  2. Answer
    Veronica
    Admin
    Veronica avatar
    1213 posts

    Posted 16 Nov 2010 Link to this post

    Hi Stuart Hemming,

    Please accept my apologies for the late reply.

    Is your FormCreating event ajaxified with RadAjaxManager? The ReponseScripts will only work after an ajax event, so make sure that your event is ajaxified:

    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
                <AjaxSettings>
                    <telerik:AjaxSetting AjaxControlID="RadScheduler1" EventName="FormCreating" />
                </AjaxSettings>
            </telerik:RadAjaxManager>

    Also in External Edit in RadDock demo openForm function is written in camel-case (e.g. the first letter is small). In your code you are trying to call the function written in Pascal-case:

    RadAjaxManager LocalManager = RadAjaxManager.GetCurrent(Page);
                  LocalManager.ResponseScripts.Add("OpenForm();");

    This is causing an error because no such function can be found. Just replace the name of the function to start with small letter and everything will be set.

    All the best,
    Veronica Milcheva
    the Telerik team
    Browse the vast support resources we have to jumpstart your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Stuart Hemming
    Stuart Hemming avatar
    1622 posts
    Member since:
    Jul 2004

    Posted 16 Nov 2010 Link to this post

    Dear Veronica,

    The RadScheduler is ajaxified, however, hadn't explicitly ajaxified the event; I didn't know I had to. Come to that, I didn't know I could! :-)

    So much to learn.

    Thanks.

    -- 
    Stuart
Back to Top