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

Is this possible?

4 Answers 127 Views
Window
This is a migrated thread and some comments may be shown as answers.
Super
Top achievements
Rank 1
Super asked on 10 Sep 2008, 07:33 PM
Hi,

I have Downloaded the ASP.Net Ajax Rad Controls for evaluation mostly to use the Rad window and the Rad Tab / MultiPage

on my main browser window I have a menu ,  the user click on a menu Item and a rad window will open showing a grid (let say is callad radwindowgrid),  the user then click Insert or Change on the grid another rad window should open (let say it is called radwindowform)  so the user can add/change data this window is opened with set_Modal(true) .  

My problem is the following:

If I add a rad window control to the radwindowgrid  then the radwindowform is limited to the size of the radwindowgrid wich in many casses the form window is larger than the grid window.  

if I open radwindowform from the main browser window, the browser window become modal,  but my gridwindow is still active.

Is there a way to have the radwindowform Modal to the radwindowgrid but float in the main browser window??

Sincerely

Fadi

4 Answers, 1 is accepted

Sort by
0
Georgi Tunev
Telerik team
answered on 11 Sep 2008, 01:57 PM
Hi Super,

I am not sure if I understand correctly your setup. I am pretty sure that there is a solution to this problem, but I need to have a better look over your project.
Please open a support ticket and send me a small sample project where I can observe the problem that you experience (make sure that the project can be run locally and does not miss a database for example - if you don't want to send your database for some reason, you can use the Nortwind one in the sample project). I will check it and get back to you with solution.


Greetings,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Super
Top achievements
Rank 1
answered on 11 Sep 2008, 02:34 PM
Hi Georgi

Thanks for you fast response,    I will try to put a sample project later today and submit to support,   basically the problem is when trying to open a new Modal rad window from existing rad window.  if the existing rad window size is 400 x 400 and the new window size is 500 X 500 the new rad window will not display fully because it is floating with in the 400 X 400 window. 

Sincerely,

Fadi

0
Georgi Tunev
Telerik team
answered on 12 Sep 2008, 01:10 PM
Hi Fadi,

I just answered your support ticket. For convenience I am pasting my reply below:



The Grid Window 2 show 2 issues, one it sets my whole browse window Modal, two I cannot attach add_close(OnClientClose) this give a Java Script error. This problem comes from the ASP.NET AJAX framework itself - just switch the debugging off in your web.config (<compilation debug="false" strict="false" explicit="true">) and you will not experience this problem. When this property is set to true, the MS AJAX framework outputs a lot of client debug code that raises the error.

What I would like to accomplish, is the form window to work as if it is opened from Grid window 2, But be Modal to just the Grid window, and allow me to attach Client side events by code.
  Making the second window modal just for the first RadWindow is not possible without modifying the skin and/or the logic of the control, which I would not recommend. What I can suggest however is to open the second RadWindow on top of the first one and set its behaviors in such way that the user would not be able to move it (so it can access the first RadWindow).
For example:


function OpenForm() { 
    var oBrowserWnd = GetRadWindow().BrowserWindow; 
    var win = oBrowserWnd.radopen("form.aspx"
    win.setSize(820, 560) 
   // win.set_modal(true) 
    win.center() 
    // This Function Cause a Java Script Error 
    win.add_close(OnClientClose);         
    win.set_behaviors(0);  
    win.show() 
 

Note that I've set the behaviors property by using an integer. I am using the fact that Telerik.Web.UI.WindowBehaviors is an enum:

None : 0,       
Resize : 1, 
Minimize : 2,
Close : 4,  
Pin : 8,
Maximize : 16,
Move: 32,
Reload: 64,
Default: (1 + 2 + 4 + 8 + 16 + 32 + 64)



Sincerely yours,
Georgi Tunev
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
0
Super
Top achievements
Rank 1
answered on 12 Sep 2008, 03:17 PM
Hi

Thanks for your fast response,  unfortunately the fix you recommended is not a valid solution ,  since the user could move /resize the first rad window,  also the first rad window could have a larger height or width than the second rad window.

I think my only alternative for now is  to resize window one to be 100+width of window 2 and 100+height of window 2,  and set the behavior to only allow close of window 2.  

one thing I have noticed,  that if I click close on window one,  it close window 1 and window 2,  but the OnClientClose Function does not get called.  a work around for now is I remove the Close from window one when I'm opening window 2 ,  and I restore it after the close of window 2

by the way the add_close(OnClientClose); does not cause script error even with debug turned on in the scenario where window 1 is the parent of window 2
the error only happen when the browser window is the parent of both window 1 and window 2.

here is my code for now,  I will be doing a lot more testing over the next few days and making sure I can have all features currently supported by IE showModalDialog and showModelessDialog behaviors.

Sincerely,

Fadi

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="GridWindow1.aspx.vb" Inherits="SampleRadWindow.WebForm1" %> 
 
<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %> 
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
 
<html xmlns="http://www.w3.org/1999/xhtml" > 
<head runat="server"
    <title>Grid window 1</title> 
      <script type="text/javascript"
         function GetRadWindow() { 
             var oWindow = null
             if (window.radWindow) 
                 oWindow = window.radWindow; 
             else if (window.frameElement.radWindow) 
                 oWindow = window.frameElement.radWindow; 
             return oWindow; 
         } 
      </script> 
     
</head> 
<body> 
    <form id="form1" runat="server"
    <div> 
         <input id="Button2" type="button" value="Open Form Window" onclick="OpenForm();" /> 
          <asp:ScriptManager id="ScriptManager" 
runat="server"/>  
  <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Behaviors="Close,Maximize,Minimize,Resize,Move" VisibleStatusbar="False"
   <Windows> 
      <telerik:RadWindow ID="window1" VisibleStatusBar="false" runat="server"
      </telerik:RadWindow> 
       </Windows> 
  </telerik:RadWindowManager>         
         
    </div> 
    </form> 
<script type="text/javascript"
    function OpenForm() { 
        var currentwindow = GetRadWindow() 
        currentwindow.setSize(920, 660) 
        currentwindow.set_behaviors(51); 
        var oManager = GetRadWindowManager(); 
        var win = oManager.getWindowByName("window1"); 
        win.setUrl("form.aspx") 
        win.setSize(820, 560) 
        win.set_modal(true) 
        win.center 
        win.add_close(OnClientClose); 
        win.set_behaviors(4);   
        win.show() 
    } 
    function OnClientClose() { 
       alert('window closed') 
        var currentwindow = GetRadWindow() 
        currentwindow.setSize(600, 600) 
        currentwindow.set_behaviors(55); 
    } 
 </script>    
</body> 
 
</html> 
 



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