How to create multiple raddockzones dynamically.How to enable its drag n drop feature,expand/collapse feature,saving the position of dock after each drag n drop.I called the below functions inside a loop.
Can u plz pointout the errors in this
Function CreateJavaScriptFunctionCall(ByVal dock As RadDock) As String
Dim dockHandleID As String = ""
For Each contrl As Control In dock.ContentContainer.Controls
If TypeOf contrl Is Label Then
dockHandleID = contrl.ClientID
End If
Next
Return "changeRadDockHandle('" + dock.ClientID + "','" + dockHandleID + "')"
End Function
Protected Sub CreateDock(ByVal strDocument As String, ByVal intTotal As Integer, ByVal sDocument As String)
Dim smExists As Boolean = False
For Each contrl As Control In Page.Form.Controls
If TypeOf contrl Is ScriptManager Then
smExists =
True
Exit For
End If
Next
If Not (smExists) Then
Dim sm As New ScriptManager()
Page.Form.Controls.Add(sm)
Page.Header.Controls.Add(
New LiteralControl("<script language='javascript'> function changeRadDockHandle(dockID,handleID){var dock = $find(dockID)dock.set_handle(document.getElementById(handleID))} </script>"))
End If
Dim zone As New RadDockZone()
Dim UpdatePanl As New UpdatePanel()
UpdatePanl.ID =
"UpdatePanelDoc" + dockcnt.ToString()
Dim dock As New RadDock()
dock.ID =
"dock" + dockcnt.ToString()
dock.Title = AppendDocumentHeader(strDocument, intTotal, sDocument)
dock.BackColor = Color.AliceBlue
dock.ContentContainer.Controls.Add(lblTableWorks1)
dock.OnClientInitialize = CreateJavaScriptFunctionCall(dock)
dock.Commands.Add(
New DockCloseCommand())
dock.Commands.Add(
New DockExpandCollapseCommand())
zone.Controls.Add(dock)
zone.Width = 700
DkLayoutDocMain.Controls.Add(zone)
DkLayoutDocMain.Controls.Add(UpdatePanl)
End Sub
Thanks