Position of Radwindow (browser resize)

8 posts, 0 answers
  1. Pan hal
    Pan hal avatar
    61 posts
    Member since:
    Aug 2009

    Posted 15 Jan 2010 Link to this post

    How to resize and position the RadWindow wrt browser size. We have used Silverlight Childwindow in our app and just by changing the width and height of childwindow  it positions correctly in center depending on browser size  . But RadWindow never position in center.
    We have Set 

     

    Radwindow. WindowStartupLocation to CenterScreen as well to centerparent. Both doesnot center the window.

    Please help.

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 19 Jan 2010 Link to this post

    Hi Pan,

     If you didn't set Width and Height of the RadWindow control and its content gets its size later (when loaded) the Window might be centered before its actual size is updated. If this is not the issue, please open a support ticket and send us a sample project that reproduces the problem - this will help us investigate the issue.

    Greetings,
    Miroslav Nedyalkov
    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.
  3. DevCraft banner
  4. Pan hal
    Pan hal avatar
    61 posts
    Member since:
    Aug 2009

    Posted 27 May 2010 Link to this post

    Can you please tell me how to make the Radwindow center wrt Browser size.  With the below code the window will be in center position first time its opened but when the browser size is changed , window will not be centered.

    How to fix this problem?


     

     

     

     

     

     

     

    With App.Current.Host.Content

     

    window.Width = (.ActualWidth - 50) / .ZoomFactor

    Window.Height = (.ActualHeight - 50) / .ZoomFactor

     

     

    End With

     

     

     

     

     

     

     

     

     

  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 01 Jun 2010 Link to this post

    Hi Pan,

     You should listen for the Resized and Zoomed events of the Application.Current.Host.Content object and recenter each time the events occur if you want to center the window every time the user resizes or zooms the browser.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  6. Pan hal
    Pan hal avatar
    61 posts
    Member since:
    Aug 2009

    Posted 01 Jun 2010 Link to this post

    Can you please send me  project (in vb) as I am not able to do it correctly.
  7. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 04 Jun 2010 Link to this post

    Hello Pan hal,

    Please find the attached project in which the approach is illustrated.

    If you need further assistance please let us know.

    Best wishes,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  8. Pan hal
    Pan hal avatar
    61 posts
    Member since:
    Aug 2009

    Posted 07 Jun 2010 Link to this post

    Hi,
      I am not able to open as the 2 projects are  in cs. Can you please send all the project in VB. Thanks
  9. Konstantina
    Admin
    Konstantina avatar
    2332 posts

    Posted 10 Jun 2010 Link to this post

    Hi Pan hal,

    The project is in VB as requested, but is build with VS 2010. Which version of Silverlight and VS you are using?
    However, the essential part of the project is in these rows of the MainPage.xaml.vb:

    Partial Public Class MainPage
        Inherits UserControl
        Dim window As MyWindow
      
        Public Sub New()
            InitializeComponent()
            AddHandler Application.Current.Host.Content.Resized, AddressOf content_Resized
            window = New MyWindow()
            window.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterOwner
            window.Show()
        End Sub
      
        Private Sub content_Resized(ByVal sender As Object, ByVal e As EventArgs)
      
            window.Left = Application.Current.Host.Content.ActualWidth / 2 - window.ActualWidth / 2
            window.Top = Application.Current.Host.Content.ActualHeight / 2 - window.ActualHeight / 2
      
        End Sub
      
    End Class

    Hope this helps.

    If you need further assistance please let us know.

    Regards,
    Konstantina
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Back to Top
DevCraft banner