This is a migrated thread and some comments may be shown as answers.

Opening a window in Form_Creating

2 Answers 49 Views
Scheduler
This is a migrated thread and some comments may be shown as answers.
Stuart Hemming
Top achievements
Rank 2
Stuart Hemming asked on 09 Nov 2010, 10:27 AM
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 Answers, 1 is accepted

Sort by
0
Accepted
Veronica
Telerik team
answered on 16 Nov 2010, 09:37 AM
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.
0
Stuart Hemming
Top achievements
Rank 2
answered on 16 Nov 2010, 11:48 AM
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
Tags
Scheduler
Asked by
Stuart Hemming
Top achievements
Rank 2
Answers by
Veronica
Telerik team
Stuart Hemming
Top achievements
Rank 2
Share this question
or