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

RadWindow in RadScheduler problem

3 Answers 122 Views
Window
This is a migrated thread and some comments may be shown as answers.
Anthony
Top achievements
Rank 1
Anthony asked on 11 Oct 2010, 01:58 PM
Update: Cannot edit thread title: should be 'RadScheduler in RadWindow problem'

Consider the following aspx form:
<telerik:RadWindowManager ID="RadWindowManager1" runat="server" Skin="Vista">
            <Windows
                <telerik:RadWindow runat="server" Behavior="Default" InitialBehavior="None" AutoSize="true"
                    Left="0px" NavigateUrl="http://www.safc.com"
                    OffsetElementID="btnDialog" OpenerElementID="btnALS"
                    Title="Sunderland AFC Website" Top="30px" VisibleStatusbar="False">
                </telerik:RadWindow>
                 
                 
 
                <telerik:RadWindow ID="rwDialog" runat="server" Behavior="Close, Move"
                    Behaviors="Close, Move" InitialBehavior="None" Modal="True"
                    NavigateUrl="MyDialog.aspx" OpenerElementID="btnDialog" AutoSize="true" Width="500px">
                    <ContentTemplate>
                         
                            <telerik:RadScheduler ID="RadScheduler1" runat="server"
                                    DataDescriptionField="App_Description" DataEndField="App_End"
                                    DataKeyField="JobID" DataRecurrenceField="App_RecurrenceRule"
                                    DataRecurrenceParentKeyField="App_RecurrenceParentID" DataSourceID="Jobs"
                                    DataStartField="App_Start" DataSubjectField="App_Subject"
                                    StartInsertingInAdvancedForm="True" SelectedView="MonthView" Width="500px">
                            </telerik:RadScheduler>
                         
                            <asp:SqlDataSource ID="Jobs" runat="server"
                                ConnectionString="<%$ ConnectionStrings:Default %>"
                                DeleteCommand=""
                                InsertCommand=""
                                SelectCommand=""
                                UpdateCommand="">
                                <DeleteParameters>
                                    <asp:Parameter Name="JobID" Type="Int32" />
                                </DeleteParameters>
                                <InsertParameters>
                                    <asp:Parameter Name="App_Subject" Type="String" />
                                    <asp:Parameter Name="App_Description" Type="String" />
                                    <asp:Parameter Name="App_Start" Type="DateTime" />
                                    <asp:Parameter Name="App_End" Type="DateTime" />
                                    <asp:Parameter Name="App_LocationID" Type="Int32" />
                                    <asp:Parameter Name="App_RecurrenceRule" Type="String" />
                                    <asp:Parameter Name="App_RecurrenceParentID" Type="Int32" />
                                    <asp:Parameter Name="App_Reminder" Type="String" />
                                    <asp:Parameter Name="App_TechnicianID" Type="Int32" />
                                    <asp:Parameter Name="App_Annotations" Type="String" />
                                </InsertParameters>
                                <UpdateParameters>
                                    <asp:Parameter Name="App_Subject" Type="String" />
                                    <asp:Parameter Name="App_Description" Type="String" />
                                    <asp:Parameter Name="App_Start" Type="DateTime" />
                                    <asp:Parameter Name="App_End" Type="DateTime" />
                                    <asp:Parameter Name="App_LocationID" Type="Int32" />
                                    <asp:Parameter Name="App_RecurrenceRule" Type="String" />
                                    <asp:Parameter Name="App_RecurrenceParentID" Type="Int32" />
                                    <asp:Parameter Name="App_Reminder" Type="String" />
                                    <asp:Parameter Name="App_TechnicianID" Type="Int32" />
                                    <asp:Parameter Name="App_Annotations" Type="String" />
                                </UpdateParameters>
                        </asp:SqlDataSource>
                    </ContentTemplate>
 
                </telerik:RadWindow>
                <telerik:RadWindow ID="RadWindow1" runat="server">
                   <ContentTemplate>
                       <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
                       <asp:Button ID="Button1" runat="server" Text="Click me" OnClick="Button1_Click" />
                   </ContentTemplate>
                </telerik:RadWindow>
            </Windows>
        </telerik:RadWindowManager>

Whenever I do anything in the RadScheduler, the RadWindow closes.

Reopening the RadWindow shows the RadScheduler in the correct state. For example, the following happens:

1. Click button to open the RadWindow1 (which contains the RadScheduler). RadScheduler1 loads properly and shows the appointments.
2. Double-Click a day to add a new appointment.
3. RadWindow Closes - why?
4. Click button to open RadWindow1
5. RadWindow opens with the RadScheduler displaying the New Appointment form (which has rendered incorrectly with overlapping controls - why?).
6. Cancel the New Appointment
7. RadWindow closes again.

NB - The contents of MyDialog.aspx is not being displayed in the RadWindow, but I assume that this is correct behavior for my implementation?

Please respond asap as I have spent too much time on what I think should be a simple task.

Regards

3 Answers, 1 is accepted

Sort by
0
Fiko
Telerik team
answered on 14 Oct 2010, 11:35 AM
Hello Anthony,

You use RadWindow's ContentTemplate property in your project and this means that the RadWindow object and its content are declared on the same page. In this case If you perform a postback, then the RadWindow object will be closed as well, because the page is refreshed. In your scenario, I suggest you use one of these solutions
  1. Wrap the RadScheduler control in a RadAjaxPanel and you should not experience the same problem:
    <telerik:RadWindow ID="rwDialog" runat="server" Behavior="Close, Move" Behaviors="Close, Move"
        InitialBehavior="None" Modal="True" NavigateUrl="MyDialog.aspx" OpenerElementID="btnDialog"
        AutoSize="true" Width="500px">
        <ContentTemplate>
            <telerik:RadAjaxPanel ID="RadAjaxPanel1" runat="server">
                <telerik:RadScheduler ID="RadScheduler1" ....>
                    .... ....
                </telerik:RadScheduler>
            </telerik:RadAjaxPanel>
        </ContentTemplate>
    </telerik:RadWindow>
  2. Move the content of the RadWindow to the MyDialog.aspx file and remove the <ContentTemplate> tag (and its content) from the RadWindow's declaration


All the best,
Fiko
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
0
Anthony
Top achievements
Rank 1
answered on 19 Oct 2010, 10:19 AM
Thanks for your response Fiko,

I started from scratch using your second recommended solution and it seems to work properly now. Are there any good resources that demonstrate how to pre-populate the RadScheduler's Advanced Insert Appointment form with information/values from the parent form?

Regards,
Anthony
0
Peter
Telerik team
answered on 22 Oct 2010, 03:24 PM
Hello Anthony,

You can use as reference the following demos - External Edit in RadDock and Advanced Templates. I hope you find them helpful.

Best wishes,
Peter
the Telerik team
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Tags
Window
Asked by
Anthony
Top achievements
Rank 1
Answers by
Fiko
Telerik team
Anthony
Top achievements
Rank 1
Peter
Telerik team
Share this question
or