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

[Solved] problem with using RadWindow in a user control

2 Answers 194 Views
Window
This is a migrated thread and some comments may be shown as answers.
Jason
Top achievements
Rank 1
Jason asked on 24 Apr 2008, 07:22 PM
Hello,
We have a FormView embedded inside two user controls that we put on several of our pages, one for inserting records and one for updating them.  The formviews are not visible initially, and the user clicks a button to make them visible.  Inside each formview is a button that opens a RadWindow.  One of the formviews is embedded inside the SelectedItemTemplate of a DataList.

The pages also use AJAX.  When I turn off the ajax, everything works fine.  However, with the ajax disabled, the radwindow opens fine from the user control embedded inside the datalist, but not the one that's initially invisible at startup outside the datalist.  However, when I try to open it with the other formview (the one not initially visible), two JavaScript errors get thrown.

The errors are:

this._windows.length is null or not an object
Object doesn't support this property or method

Here's some sample code from the aspx page:

<uc:SignUps_Insert_frmvu id="SignUps_Insert_frmvu" runat="server">
<asp:DataList id="Cls_SignUps_datlst" runat="server" ... >
    <ItemTemplate>
        ....
    </ItemTemplate>
    <SelectedItemTemplate>
        <uc:SignUps_Details_frmvu id="SignUps_Details_frmvu" runat="server" ... />
    </SelectedItemTemplate>
</asp:DataList>

(The RadWindow opening is handled from JavaScript).

On the insert formview user control:

<asp:FormView id="SignUps_Insert_frmvu" runat="server" Visible="false" ... >
    <InsertItemTemplate>
        ...
        <asp:HiddenField ID="ClsID_hdn" runat="server" ... />
        <uc:Btn id="Select_Event_btn" runat="server" ... /><br />
        ...
    </InsertItemTemplate>
</asp:FormView>

In the code-behind of the insert formview user control (VB.NET):

    Protected Overrides Sub OnPreRender(ByVal e As EventArgs)
        ...
        If (Page.FindControl("Select_Event_radwdw_mgr") Is Nothing) Then
            Dim Select_Event_radwdw_mgr As RadWindowManager = New RadWindowManager()
            With Select_Event_radwdw_mgr
                .ID = "Select_Event_radwdw_mgr"
                .VisibleOnPageLoad = False
                .Width = 450
                .Height = 410
            End With
            MyBase.Controls.Add(Select_Event_radwdw_mgr)
        End If
        ...
    End Sub

On the details formview user control:

<asp:FormView id="SignUps_Insert_frmvu" runat="server" Visible="false" ... >
    <ItemTemplate>
        ...
    </ItemTemplate>
    <EditItemTemplate>
        ...
        <asp:HiddenField ID="ClsID_hdn" runat="server" ... />
        <uc:Btn id="Select_Event_btn" runat="server" ... /><br />
        ...
    </EditItemTemplate>
</asp:FormView>

If anybody can help me it would be appreciated.  By the way, I'm new to this forum and this is my first-ever post, so if it's sloppy or confusing please forgive me.

Thanks,
Jason

2 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 29 Apr 2008, 03:33 PM
Hi Jason,

I am afraid that the provided information is not enough for us to determine the exact reason for the problem. Please open a new support ticket and send us a small sample project where this behavior can be observed. We will check it and once we have a better view over your exact setup, we will do our best to help.



Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
Jason
Top achievements
Rank 1
answered on 29 Apr 2008, 04:07 PM
Never mind, we figured it out.  There's an UpdatePanelsRenderMode property in the RadAjaxManager that was set to Block by default.  If we set it to Inline, the problem goes away.  Thank you for your time anyway.

Jason
Tags
Window
Asked by
Jason
Top achievements
Rank 1
Answers by
Georgi Tunev
Telerik team
Jason
Top achievements
Rank 1
Share this question
or