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

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

1 Answer 26 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 07 Sep 2011, 05:24 PM
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
    Next
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)
Next
 
' 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)
Next
 
For Each Zone As RadDockZone In Zones
    RadAjaxManager1.AjaxSettings.AddAjaxSetting(Zone, lblMessage, RadAjaxLoadingPanel1)
Next
 
RadAjaxManager1.AjaxSettings.AddAjaxSetting(rgAvailableDocks, pnlAvailableDocks, RadAjaxLoadingPanel1)

Thanks in advance!

1 Answer, 1 is accepted

Sort by
0
Pero
Telerik team
answered on 12 Sep 2011, 01:22 PM
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.

Regards,
Pero
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
Tags
Dock
Asked by
Josh
Top achievements
Rank 1
Answers by
Pero
Telerik team
Share this question
or