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

Position of Radwindow (browser resize)

7 Answers 242 Views
Window
This is a migrated thread and some comments may be shown as answers.
Pan hal
Top achievements
Rank 1
Pan hal asked on 15 Jan 2010, 10:07 PM
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.

7 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 19 Jan 2010, 01:31 PM
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.
0
Pan hal
Top achievements
Rank 1
answered on 27 May 2010, 10:56 PM

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

 

 

 

 

 

 

 

 

 

0
Miroslav Nedyalkov
Telerik team
answered on 01 Jun 2010, 02:06 PM
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.
0
Pan hal
Top achievements
Rank 1
answered on 01 Jun 2010, 02:27 PM
Can you please send me  project (in vb) as I am not able to do it correctly.
0
Konstantina
Telerik team
answered on 04 Jun 2010, 11:30 AM
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.
0
Pan hal
Top achievements
Rank 1
answered on 07 Jun 2010, 06:02 PM
Hi,
  I am not able to open as the 2 projects are  in cs. Can you please send all the project in VB. Thanks
0
Konstantina
Telerik team
answered on 10 Jun 2010, 10:05 AM
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.
Tags
Window
Asked by
Pan hal
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Pan hal
Top achievements
Rank 1
Konstantina
Telerik team
Share this question
or