Updating RadDock Title on PostBack

3 posts, 0 answers
  1. Deepshikha
    Deepshikha avatar
    4 posts
    Member since:
    Feb 2009

    Posted 18 Nov 2009 Link to this post

    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. Pero
    Admin
    Pero avatar
    1156 posts

    Posted 19 Nov 2009 Link to this post

    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.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Phil
    Phil avatar
    84 posts
    Member since:
    Apr 2005

    Posted 20 Mar 2012 Link to this post

    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.

Back to Top