Change RadWindow Title from Silverlight

2 posts, 1 answers
  1. loowool
    loowool avatar
    60 posts
    Member since:
    Sep 2006

    Posted 23 May 2011 Link to this post

    Dear Telerik,
    From an ASP.NET application, I open an ASPX page in a maximized RadWindow. This page runs a Silverlight Application that at some point needs to change the title of the RadWindow.

    I tried the following:
    HtmlDocument document = HtmlPage.Document;
    document.SetProperty("title", "My Title");

    That did not work, then I tried:
    string title = "My Title";
    HtmlWindow top = HtmlPage.Window.GetProperty("top") as HtmlWindow;
    HtmlDocument htmlDoc = top.GetProperty("document") as HtmlDocument;
    htmlDoc.SetProperty("title", title);
    And that did not work either.

    How Do I do that?

    Salah A. Malaeb
    TeknoBuild
  2. Answer
    Georgi Tunev
    Admin
    Georgi Tunev avatar
    7207 posts

    Posted 24 May 2011 Link to this post

    Hello Salah,

    The RadWindow's title, can be changed via its client-side API only. You need to get a reference to the RadWindow wrapper from within the content page (by using the GetRadWindow() function) and then call its set_title() method.
    e.g.
    function GetRadWindow()
    {
      var oWindow = null;
      if (window.radWindow)
         oWindow = window.radWindow;
      else if (window.frameElement.radWindow)
         oWindow = window.frameElement.radWindow;
      return oWindow;
    }     
     
     
    function changeTitle()
    {
        var oWnd = GetRadWindow();
        oWnd.set_title("my new title");
    }



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

  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top