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

Can't anchor window to top of page...

2 Answers 52 Views
Window
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 15 Dec 2009, 02:21 PM
Hi Everyone,

I upgraded from the ASP.Net RadWindow to the ASP.Net AJAX RadWindow, and now, when I dynamically add a window, the "top" property does not work...no matter what I try (and I've tried quite a few things...), the window opens up centered...
  Help!!!

code:
     Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles OpenerButton.Click 
        Dim NewWindow As New Telerik.Web.UI.RadWindow 
        With NewWindow 
            .NavigateUrl = "http://www.telerik.com" 
            .Title = "A RadWindow" 
            .Modal = True 
            .Height = Unit.Pixel(500) 
            .Width = Unit.Pixel(500) 
            .Top = Unit.Pixel(1) 
            .InitialBehaviors = Telerik.Web.UI.WindowBehaviors.None 
            .ReloadOnShow = False 
            .VisibleOnPageLoad = True 
            .VisibleStatusbar = False 
            .EnableViewState = True 
            .DestroyOnClose = True 
            .ID = "ARadWindow" 
            .Behaviors = Telerik.Web.UI.WindowBehaviors.Close 
            .OnClientClose = "OnClientClose" 
            .VisibleTitlebar = True 
            .Visible = True 
        End With 
        RadWindowManager1.Windows.Add(NewWindow) 
    End Sub 
 


aspx:
    <form id="form1" runat="server"
    <asp:Button ID="OpenerButton" runat="server" Text="Button" /> 
    <telerik:RadScriptManager ID="RadScriptManager1" runat="server"
    </telerik:RadScriptManager> 
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server" Top="0px"
    <Windows> 
        <telerik:RadWindow ID="RadWindowPlaceholder" runat="server" Top="0px" OnClientShow="OnClientShow"
        </telerik:RadWindow> 
    </Windows> 
    </telerik:RadWindowManager> 
    </form> 
 

2 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 16 Dec 2009, 10:19 AM
Hi Sam Tran,

When the window is modal, the positioning properties (OffsetElementId, Left, and Top) have no effect. If you want to change the position, then try attaching client event '' and change the position using moveTo() method.

VB:
 
    . . . 
      .OnClientClose = "OnClientClose"  
      .OnClientShow = "OnClientShow"
      .VisibleTitlebar = True  
    . . . 

JavaScript:
 
<script type="text/javascript"
    function OnClientShow(sender, eventArgs) { 
        sender.moveTo(0,0);       
    } 
</script> 

-Shinu.
0
Georgi Tunev
Telerik team
answered on 17 Dec 2009, 09:04 AM
Hi guys,

I just want to notify you that the problem with the Top position is a confirmed bug in RadWindow that we discovered several days ago - we will fix it for the next update.


Best wishes,
Georgi Tunev
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
Tags
Window
Asked by
Sam
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Georgi Tunev
Telerik team
Share this question
or