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

Telerik.Web.UI.RadWindow() initialization problem

1 Answer 153 Views
Window
This is a migrated thread and some comments may be shown as answers.
ronny
Top achievements
Rank 1
ronny asked on 04 May 2011, 04:59 PM
Hi,
I generate the window programmatically, this works , the iwndow pop's up but without any setting at all , somehow not one single setting renders ...  any idea ???, TKS!
***in my page ****
  
   
if (!IsPostBack)
        {
           GetTelerikWindow( placeholder );  }
  
**** In library *************
public static void GetTelerikWindow( PlaceHolder ph , string WindowId, string windowname, int height, int width, Boolean autosize)
        {
  
  
            RadWindowManager TWindowMgr = new RadWindowManager();
            TWindowMgr.ID="Manager_"+WindowId;
            TWindowMgr.EnableShadow = true;
              
              
  
             
            RadWindow TWindow = new RadWindow();
            TWindow.ID=WindowId;
            TWindow.Title=windowname;
            TWindow.ShowContentDuringLoad=false ;
            TWindow.Width=width;
            TWindow.Height=height;
            TWindow.VisibleStatusbar=false;
            TWindow.Modal = true;
            TWindow.AutoSize = autosize;
            TWindow.KeepInScreenBounds = true;
            TWindow.Skin = "WebBlue";
            TWindowMgr.Controls.Add(TWindow);
  
            ph.Controls.Add(TWindowMgr);
  
        }

1 Answer, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 06 May 2011, 01:56 PM
Hello ronny,

 
I examined your code and it is correct. However, you add a new RadWindowManager each time you call the method and I assume that this might be causing the issue in case you use radopen on the client. The RadWindowManager was designed as a singleton and when there are more then one managers on the page only one of them is "active" when calling radopen (however, you can use managerClientObject.open to decide what manager to use).

This being said, what I assume is that you actually add let's say RadWindow2 to RadWindowManager2 but when calling radopen(url, "RadWindow2"), this is executed by RadWindowManager1  and since it does not have an added RadWindow2 - it creates a new RadWindow with its own settings.

What I can suggest is to have only one RadWindowManager and expose it e.g as a property - after that add the new RadWindows to it. This will resolve not only this issue but you will also have almost twice less controls - hence better performance.

I hope that my assumption, explanations and suggestion are helpful, let me know how it goes. 



All the best,
Svetlina
the Telerik team

Browse the vast support resources we have to jump start 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.

Tags
Window
Asked by
ronny
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Share this question
or