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

Change RadWindow Title from Silverlight

1 Answer 53 Views
Window
This is a migrated thread and some comments may be shown as answers.
loowool
Top achievements
Rank 2
loowool asked on 23 May 2011, 12:44 PM
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

1 Answer, 1 is accepted

Sort by
0
Accepted
Georgi Tunev
Telerik team
answered on 24 May 2011, 09:30 AM
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.

Tags
Window
Asked by
loowool
Top achievements
Rank 2
Answers by
Georgi Tunev
Telerik team
Share this question
or