Centralize the window after loading the radgrid

3 posts, 0 answers
  1. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 26 Oct 2009 Link to this post

    Hello Team,

    I have one radwindow with a Radgrid inside it, I'm populating the grid in dataservice complete event, so when the popup is opened  window is centralized (which is centralized using win.WindowStartupLocation = WindowStartupLocation.CenterScreen this code while initializing the window).

    ie before populating the radgrid the window is centralized.

    But one my collection is loaded and the radgrid is loaded this window is expanding towards the right.
    How can i make that centralized? 
    is there any property like window.Center()  which is available in the ASP.net window?
    or is there any way to refresh the window so that it will automatically centralized?

  2. Miroslav Nedyalkov
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 28 Oct 2009 Link to this post

    Hello Raj,

    Unfortunately there is no such method, but it sounds really useful. I log your request in our system and we will consider implementing it in one of the upcoming releases.

    In order to workaround this problem you could either load the data before open the RadWindow control or implement your own centralization logic - it is really simple - set window's Left property to (screenWidth - window.ActualWidth) and the Top property to (screenHeight-window.ActualHeight), where screenWidth and screenHeight is the size of your application. 

    Hope this helps.

    Best wishes,
    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. Raj A R
    Raj A R avatar
    31 posts
    Member since:
    Oct 2009

    Posted 29 Oct 2009 Link to this post

    thanks Miroslav ,

    the below code solves my problem :)

    Size appSize = Application.Current.RootVisual.RenderSize;
    window.Left = Math.Round((appSize.Width / 2) - (window.ActualWidth / 2), 0);
    window.Top = Math.Round((appSize.Height / 2) - (window.ActualHeight / 2), 0);

Back to Top