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

radwindow does not show

4 Answers 272 Views
Window
This is a migrated thread and some comments may be shown as answers.
Henk
Top achievements
Rank 1
Henk asked on 31 Oct 2014, 04:45 PM
Hi,

I am developing a DNN module using telerik ajax controls. I am trying to open a radwindow in a radgrid editform template;

Settings: dotnetnuke 7 + christoc module, telerik ajax ui conrols: 2014 Q2 release 2. I have registered a usercontrol Patientupdate.ascx in DNN. Inside it I have several controls i.e. a radgrid (ResultaatGrid)  and a radwindow, also as a user control (but not registered in DNN)  named COVUserControl. The radwindow is called inside a radgrid in formedit mode when a button is click.

a snippet of the code for the radwindow(inside the patientupdate.ascx)

In the radwindow I have put the usercontrol (COVUserControl) and inside the user control I have defined a radgrid.

<telerik:RadWindow ID="COVWindow" Title="Editing record" Width="270"
        Height="540" VisibleOnPageLoad="false" Behaviors="Resize, Minimize, Close, Pin, Maximize, Move"
        Left="610" EnableShadow="true" runat="server" OnClientClose="refreshGrid" Modal="true">
    <ContentTemplate>
         <asp:Panel ID="Panel1" runat="server">
                <COVUC:COVUserControl runat="server" ID="COVUCID"/>
        </asp:Panel>
    </ContentTemplate>
</telerik:RadWindow>

In the edit template I have a button named <COV check> (in the patientupdate.ascx)  and in the code behind of the patientupdate.ascx.cs

in the ResultaatGrid_Itemcommand  I have the following code:

         protected void ResultaatGrid_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "COV")
            {
                GridEditableItem editedItem = e.Item as GridEditableItem;

                string pCperID = editedItem.GetDataKeyValue("cpersoon_id").ToString();
                COVWindow.Width = 500;
                COVWindow.Height = 250;
                COVUserControl COVUC1 = COVWindow.ContentContainer.FindControl("COVUCID") as COVUserControl;
                COVUC1.cPersoonID = pCperID;
                RadGrid COVGrid = COVUC1.FindControl("COVGrid") as RadGrid;
                string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show(); Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
                ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);
                COVGrid.Rebind();
            }

        }


The problem is that the radwindow does not pop-up.  (I have check the pop-up in host -> extension-> and check allow pop-ups for the module).

When debugging (attach) I see Covgrid.rebind is fired because it fires the radgrid need datasource of the grid inside the COVUserControl.

I think that the following code lines does not fire:

    string script = "function f(){$find(\"" + COVWindow.ClientID + "\").show();Sys.Application.remove_load(f);}Sys.Application.add_load(f);";
    ScriptManager.RegisterStartupScript(this, this.GetType(), "key", script, true);

Simalar code works (except the radscriptmanager which I cannot used it in DNN because DNN used it's own scriptmanager) , the radwindow pop-up, when NOT a dotnetnuke module. (if the code in patientupdate.ascx is moved to a plain aspx).

Please help, I need to solve this issue :-(

Thanks in advance,

Regards,

Henk

4 Answers, 1 is accepted

Sort by
0
Marin Bratanov
Telerik team
answered on 03 Nov 2014, 02:32 PM

Hello Henk,

We do not support the DNN environment and if you have issues with it that do not manifest in a "regular" aspx page I advise reaching out to their community in their specific forums.

Generally, RadWindows are not blocked by popup blockers in the browser because they are not an actual browser tab/window, but a collection of HTML, CSS and JavaScript in the current page.

The most likely reason for the problem you describe is a JavaScript error so I advise that you examine the browser console for that and try to resolve it.

Another possible reason for a problem would be that the script is, indeed, not registered. Since this is a standard .NET method, the issue would be probably in the DNN site and what I can suggest at this point is that you try the following syntax:

ScriptManager.RegisterStartupScript(this.Page, this.Page.GetType(), "someRANDOMkey", script, true);

You can also try registering a simple alert() in the Sys.Application.Load event to see if that fires. If it does not - then the problem is with the way DNN works and registers scripts. In case the $find() call returns null, you can try adding a small timeout in the code to give the browser a bit more time to create the client-side objects.

Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Henk
Top achievements
Rank 1
answered on 03 Nov 2014, 03:47 PM
Hi Marin,

Thanks, your suggestion using "this.Page" did the trick.... I have tried "Page" but NOT the combination :-( I dont know why "this" only does not work in DNN but OK in normal aspx....

I understand that telerik does not specifically support DNN but I encounters sometimes issues with telerik controls in DNN where equivalent asp controls works correctly. For example issue with radcombobox and not with normal asp dropdownlist. I am choosing telerik for it added functionality in comparison with the standard asp controls. If I cannot trust telerik controls when developing for dotnetnuke then the benefit using telerik controls, for me, is diminishing. But I am glad for your suggestion and not only referring that telerik does not support DNN...

Thanks,
0
Marin Bratanov
Telerik team
answered on 03 Nov 2014, 04:12 PM

Hi Henk,

DNN is a very complex environment that alters the behavior of various things (you have seen this yourself with the script registration) and we cannot know what they change, nor how they change it. This is why I asked whether your issue was reproducible in a regular webform.

We do try to make our controls robust and versatile, but we ultimately rely on a common foundation (ASP and .NET) and if parts of that are changed to work in a non-standard way, we cannot anticipate or account for that.

We do try to help even in such cases, and I also hope that using our controls will bring you benefits in the future as well.


Regards,

Marin Bratanov
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Henk
Top achievements
Rank 1
answered on 04 Nov 2014, 10:42 AM
I value your service despite DNN is not officially supported and the easy answer would be to to look else where... But you´re suggestions (and colleagues also) shows good customer support.
Tags
Window
Asked by
Henk
Top achievements
Rank 1
Answers by
Marin Bratanov
Telerik team
Henk
Top achievements
Rank 1
Share this question
or