Question

I have a RadWindow as following:

<telerik:RadWindow ID="PIQRadWindow" Modal="true" runat="server" Skin="Default" Behaviors="Close,Move" CssClass="RadWindowCustomClass" VisibleStatusbar="false" width="400px" OnClientClose="RadWindowClose">
    <ContentTemplate>
    <pd:uc_PopupDropdown ID="pdPIQScore" enableviewstate="False" Draggable="true" isInternal="true" ISOC="ProjectInstructionQuality" DivContent = "pdPIQScore" ScriptPrefix = "OFS_" runat="server" />  
    </ContentTemplate>     
    </telerik:RadWindow>

I want it to be closed within a onclick event I defined. I tried to use

   function getRadWindow() {
      var oWindow = null;
      if (window.radWindow) oWindow = window.radWindow;
      else if (window.frameElement.radWindow) oWindow = window.frameElement.radWindow;
      return oWindow;
   }

   function clientClose() {   
      getRadWindow().close();
   }

But it's not working for me. Error message: "window.frameElement is null".

Anyone has ideas?

Was it helpful?

Solution

You must use $find() when using the ContentTemplate. You can either keep a reference in a global JS variable (you can populate the variable in Sys.Application.Load), or create functions that will open and close the dialog and call them whenever needed. Check this demo's code: http://demos.telerik.com/aspnet-ajax/window/examples/contenttemplatevsnavigateurl/defaultcs.aspx.

OTHER TIPS

Have you checked out this post? If so, please share some more of your code so we can see exactly whats going on. How to close the radwindow on serverside and refresh the parent page

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top