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

RadDock client-side programming Questions - cloning - adding docks dynamically

1 Answer 34 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Michael Hunt
Top achievements
Rank 1
Michael Hunt asked on 17 Oct 2014, 01:14 PM
Hi,

We are using version 2014.2.724.40 of you ASP.NET for AJAX controls.

I'm experimenting with creating RadDocks dynamically via your client-side api.  I have a couple of questions.

Q1) I've read in many forum posts that it cannot reliably / effectively / safely be done.  Is that still true?

Currently, I'm cloning an existing RadDock using javascript, then I want to change a few of the properties that are saved with the Dock's state.  The first property I want to set or change, is the Dock's UniqueName property.  When I look at the RadDock in debug mode, I see that it has a set_uniqueName() method.  But you don't document that method in your help file.   When I use it to set the uniqueName property, it works.  I also use the undocumented set_tag() method...

Q2)  How dangerous is it to use the Dock's set_uniqueName and set_tag methods, since they aren't documented?  I obviously don't want to risk using a method that might be changed or removed in the future.

I use the Dock's Tag property to indicate what user control I want to load in the RadDock.  After I set these properties, I do an ajaxRequest postback to save the state of all the RadDocks.  All of this is working.

My last step is to figure out how to reload the content of the newly added RadDock, without refreshing any of the other RadDocks.

Presently, the new cloned RadDock contains the same user control as the one I cloned it from.  But I know I've saved the new state of it because if I reload the page (which reloads all the RadDocks), then the new cloned RadDock contains the correct user control.

Q3)  Is there a client-side method I can use to reload the content (refresh) a specific RadDock, without refreshing the others?

Thanks,
Michael

1 Answer, 1 is accepted

Sort by
0
Slav
Telerik team
answered on 22 Oct 2014, 11:16 AM
Hi Michael,

When you use the clone method of RadDock the dock that is created exists only on the client and not on the server. This means that such docks will be removed when you perform a postback. When you implement scenario with dynamically created docks that should persist through postback you need to create them on the server as described in the following help article: http://www.telerik.com/help/aspnet-ajax/dock-control-creation.html

The methods set_uniqueName and set_tag are not included in the documentation, because they are not implemented. They are generated automatically during the creation of the client-side API of the dock control.

Updating the content only of selected docks is possible if you place a conditionally updated UpdatePanel that wraps the dock content in the ContentTemplate of each dock, similarly to the following setup:
<telerik:RadDock runat="server" ID="RadDock1" Title="ContentTemplate">
    <ContentTemplate>
        <asp:UpdatePanel ID="Updatepanel1" runat="server">
            <ContentTemplate>
                <asp:label ID="Label1" text="RadDock content" runat="server" />
            </ContentTemplate>
        </asp:UpdatePanel>
    </ContentTemplate>
</telerik:RadDock>

Overall, if you want the dynamically created docks to remain on the page after you perform a posback, I would suggest generating them on the code-behind.

Regards,
Slav
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
Dock
Asked by
Michael Hunt
Top achievements
Rank 1
Answers by
Slav
Telerik team
Share this question
or