How to "unclose" a Dock using RadAjaxManager without updating the entire RadDockLayout

2 posts, 0 answers
  1. Josh
    Josh avatar
    5 posts
    Member since:
    Aug 2011

    Posted 07 Sep 2011 Link to this post

    I have a RadGrid that shows all the docks that have been closed.  It is updated asynchronously from a DockCloseCommand.  I want to be able to add records from that grid back as visible docks without sending the markup for the entire RadDockLayout or RadDockZone.  I plan to bind data to my docks client-side, and updating the RadDockLayout or RadDockZone will overwrite the data.

    I tried to add an ajax setting for the RadGrid that holds the closed docks as the updated control to the RadDock it is updating, but it doesn't seem to be working (1st snippet below).

    Relevant code snippets:

    Private Sub rgAvailableDocks_DataBound(ByVal sender As Object, ByVal e As System.EventArgs) Handles rgAvailableDocks.DataBound
        For Each item As GridDataItem In rgAvailableDocks.Items
            Dim addlnkbtn As LinkButton = item.FindControl("lnkbtnAddDock")
            If addlnkbtn IsNot Nothing Then
                Dim DockUniqueName As String = DirectCast(item.DataItem, DataRowView).Row.Field(Of String)("DockUniqueName")
                'UniqueNameToDock(DockUniqueName) => RadDock I want to update (make visible)
                RadAjaxManager1.AjaxSettings.AddAjaxSetting(addlnkbtn, UniqueNameToDock(DockUniqueName))
            End If
    End Sub

    Page.Load event:
    ' Each of these RadGrid objects are inside a RadDock
    For Each Grid As RadGrid In Grids
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Grid, Grid)
    ' A postback on a Dock should update the lblMessage (Label), the Panel that shows the
    ' closed/available docks, and the header the dashboard header
    For Each Dock As RadDock In Docks
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Dock, lblMessage)
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Dock, pnlAvailableDocks, RadAjaxLoadingPanel1)
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Dock, pnlDashboardHeader, RadAjaxLoadingPanel1)
    For Each Zone As RadDockZone In Zones
        RadAjaxManager1.AjaxSettings.AddAjaxSetting(Zone, lblMessage, RadAjaxLoadingPanel1)
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(rgAvailableDocks, pnlAvailableDocks, RadAjaxLoadingPanel1)

    Thanks in advance!
  2. Pero
    Pero avatar
    1156 posts

    Posted 12 Sep 2011 Link to this post

    Hi Josh,

    A trip to the server is not necessary to save the closed state of the Dock. Closing it on the client is enough for the dock to remain closed on postbacks. A Dock object can be closed programmatically using the RadDock.set_closed(true/false) client-side method.
    I noticed that you use the RadDock's UniqueName to create an ajax setting, which would work only in the case when the UniqueName equals the UniqueID. So, I would recommend using the RadDock's UniqueID to be sure that it will be updated by the Ajax postback.

    If the problem persists please send us a sample project that demonstrates the unwanted behavior and we will do our best to help you resolve the issue.

    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft R3 2016 release webinar banner
Back to Top