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

Updating RadDock Title on PostBack

2 Answers 46 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Deepshikha
Top achievements
Rank 1
Deepshikha asked on 18 Nov 2009, 09:44 AM
Hi,

I have a RadDock that has a user control inside it. The control is embedded in a RadAjaxPanel. The rough structure is something like this

<telerik:RadDock id="xxxxx"..........................>
<ContentTemplate>
     <telerik:RadAjaxPanel id="xxxx"......................>
         <Usercontrol:Mycontrol   Id="xxx" runat="server" onButtonClick="Button_Click"............ />
     </telerik:RadAjaxPanel>
 </contentTemplate>
</telerik:RadDock>


Whenver the Button_Click event is fired, I want the RadDock title to be updated.
Is there a way we could achieve this ?

2 Answers, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 19 Nov 2009, 11:36 AM
Hello Deepshikha,

One way (not necessarily the best way - just to give you an idea) of doing this is handling the OnResponseEnd (ClientEvents-OnResponseEnd) client-side event of the RadAjaxPanel and using the dock's set_title(Title) client side method to update the Title of the RadDock. You can pass the value from the server through a HiddenField inside the panel and setting the dock title to the HiddenField. Please note that you also need to update the RadDock.Title property on the server in order for the new title to be persisted in the ViewState.

I have created a sample project based on the above explained scenario. You can find it attached to the thread.

Best wishes,
Pero
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
Phil
Top achievements
Rank 2
answered on 20 Mar 2012, 04:48 PM

Despite being in the documentation, it would appear that set_title is no longer a valid method for raddock, certainly not in Q1 2012.

"Microsoft JScript runtime error: Object doesn't support property or method 'set_title'"

Anu suggestions?

My bad!

I changed my code from

function dock2Title(docktitle) {
     var oDock = document.getElementById('<%= rd2.ClientID %>');
     oDock.set_title(docktitle);
 }

to

 

function dock2Title(docktitle) {
    var oDock = $find('<%= rd2.ClientID %>');
    oDock.set_title(docktitle);
}

and it now works fine.

Tags
Dock
Asked by
Deepshikha
Top achievements
Rank 1
Answers by
Pero
Telerik team
Phil
Top achievements
Rank 2
Share this question
or