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

Open window in code

5 Answers 200 Views
Window
This is a migrated thread and some comments may be shown as answers.
Wicus
Top achievements
Rank 1
Wicus asked on 30 Jul 2008, 11:29 AM
Hi...can any1 help...wat code will i use to open a radwindow from c# code behind?

5 Answers, 1 is accepted

Sort by
0
Svetlina Anati
Telerik team
answered on 30 Jul 2008, 11:34 AM
Hi Wicus,

I suggest to set the radWindow's VisibleOnPageLoad property to true at the particular place where you want to show the RadWindow, e.g:

//In case you have a single RadWindow:  
 
RadWindow1.VisibleOnPageLoad = true;  
 
//In case you have a RadWindow declared in a RadWindowManager:  
 
RadWindowManager1.Windows[0].VisibleOnPageLoad = true


All the best,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Wicus
Top achievements
Rank 1
answered on 30 Jul 2008, 12:16 PM
Hi...thnx for the reply...it works now...can i ask another question...now that the window is open....it displays a form...how will i close the window on a buttons click event?
0
Svetlina Anati
Telerik team
answered on 30 Jul 2008, 12:46 PM
Hi Wicus,

I am not able to provide a particular advice until I have all the needed information about your particular scenario. Would you please clear the following:

  1. Is the button placed on the main page or in the RadWindow?
  2. Where do you need to close it from - client or server?

I also recommend to examine our online help documentation and demos - they show most of the desired, basic functionality as the one you ask for.

All the best,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Wicus
Top achievements
Rank 1
answered on 30 Jul 2008, 12:51 PM
Hi Svetlina,

the button is on a new form in the radWindow....it can close server or client...which ever is quicker!
0
Svetlina Anati
Telerik team
answered on 01 Aug 2008, 01:21 PM
Hi Wicus,

You can achieve the desired behavior on the client by hooking up the OnClientClick event of the button, obtaining a reference to the RadWindow and call its close() method.

The button markup:

  <asp:Button runat="server" ID="btn_RefreshFigures" OnClientClick="CloseWindow();return false;" Text="Close the RadWindow" />   


Reference the RadWindow from its content page and close it:

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

Please, note that all the code should be placed at the external page which is loaded in the RadWindow. I also again recommend to examine the online help and demos because they show this functionality.

All the best,
Svetlina
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Window
Asked by
Wicus
Top achievements
Rank 1
Answers by
Svetlina Anati
Telerik team
Wicus
Top achievements
Rank 1
Share this question
or