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

How to remove Pin,Min,Max of 2nd Rad Window.

5 Answers 325 Views
Window
This is a migrated thread and some comments may be shown as answers.
ALEX
Top achievements
Rank 1
ALEX asked on 03 May 2011, 09:13 AM
Hi expert,

          I follow Radwindow Demo. After that i want to remove Pin, Min, Max button of 2nd Window. How should i remove it? My code is excetly same with Demo.


Best Regards,

5 Answers, 1 is accepted

Sort by
0
Cori
Top achievements
Rank 2
answered on 03 May 2011, 01:04 PM
Hello Alex,

What does your page markup look like? Do you have the same behaviors setup for both RadWindows?
0
Accepted
Shinu
Top achievements
Rank 2
answered on 03 May 2011, 01:56 PM
Hello Alex,

I am not quite sure about the way you are opening windows. Here is the scenario that I tried. There are several ways by which you can accomplish this. If you want to set this from mark up, then try to set the Behaviors.

aspx:
<<telerik:RadWindowManager ID="RadWindowManager1" ShowContentDuringLoad="false" VisibleStatusbar="false"
ReloadOnShow="true" runat="server" Skin="Sunset" EnableShadow="true" >
 <Windows>
 <telerik:RadWindow ID="RadWindow1" runat="server" Behaviors="Default"  NavigateUrl="~/Design.aspx">
 </telerik:RadWindow>
 <telerik:RadWindow ID="RadWindow2" NavigateUrl="Window.aspx" Behaviors="Pin" runat="server"
     Width="650" Height="480" Modal="true">
</telerik:RadWindow>
</Windows>
</
telerik:RadWindowManager>

If you want to do the same from client side, then try the following

Javascript:
<script type="text/javascript">
function OnClick()
  {
  var window = $find('<%= RadWindow1.ClientID %>');
  window.set_behaviors(Telerik.Web.UI.WindowBehaviors.Pin + Telerik.Web.UI.WindowBehaviors.Close)
  window.show();
  }
 function OnClick2()
  {
  var window = $find('<%= RadWindow2.ClientID %>');
  window.setUrl('Append.aspx');
  window.set_behaviors(Telerik.Web.UI.WindowBehaviors.Move + Telerik.Web.UI.WindowBehaviors.Close)
   window.show(); 
  }
</script>

Also check the following documentation.
RadWindow Methods

Thanks,
Shinu.
0
ALEX
Top achievements
Rank 1
answered on 04 May 2011, 02:40 PM
Hi Shinu,

        Thanks for your reply and suggestion. Now i can be solved it. But i'm not understand when i follow your code, it does not work. My page is same Demo.

function openWin2()
        {
            var parentPage = GetRadWindow().BrowserWindow;
            var parentRadWindowManager = parentPage.GetRadWindowManager();
            var oWnd2 = parentRadWindowManager.open("Dialog2.aspx", "RadWindow2");
            window.setTimeout(function ()
            {
                oWnd2.setActive(true);                      
            }, 0);
           oWnd2.set_behaviors(Telerik.Web.UI.WindowBehaviors.Pin + Telerik.Web.UI.WindowBehaviors.Reload + Telerik.Web.UI.WindowBehaviors.Close); // does not work
              oWnd2.set_behaviors(76); //work it.

        }

Best Regards,
0
Accepted
Svetlina Anati
Telerik team
answered on 06 May 2011, 01:44 PM
Hello ALEX,

 The enumerator type you have used Telerik.Web.UI.WindowBehaviors is part of the source code of the RadWindow control and in your case you try to use them on a page that does not contain a RadWindow (your page is actually loaded inside it but it is a separate document). That is why a js error occurs because the enumerator is not defined there.


What I can suggest is the following:

1) Put a RadWindow in this content page if your scenario needs it and keep this code - it will start working.

2) If you do not need another RadWindow on that page, make sure that you set the behaviors in the context of the parent page which has the RadWindow scripts.

You can do e.g the following:

main page:

function setBehaviors(oWnd) {
    oWnd.set_behaviors(Telerik.Web.UI.WindowBehaviors.Pin + Telerik.Web.UI.WindowBehaviors.Reload + Telerik.Web.UI.WindowBehaviors.Close);
}


content page:

function openWin2() {
    var parentPage = GetRadWindow().BrowserWindow;
    var parentRadWindowManager = parentPage.GetRadWindowManager();
    var oWnd2 = parentRadWindowManager.open("Dialog2.aspx", "RadWindow2");
    window.setTimeout(function () {
        oWnd2.setActive(true);
    }, 0);
    parentPage.setBehaviors(oWnd2);
}

I hope that my explanations, suggestions and sample code are helpful, let me know how it goes.


Kind regards,
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.

0
ALEX
Top achievements
Rank 1
answered on 09 May 2011, 04:02 AM
Hi Svetlina ,

          Good Job! It work for me.
Tags
Window
Asked by
ALEX
Top achievements
Rank 1
Answers by
Cori
Top achievements
Rank 2
Shinu
Top achievements
Rank 2
ALEX
Top achievements
Rank 1
Svetlina Anati
Telerik team
Share this question
or