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

creating multiple raddockzones dynamically inside a loop

2 Answers 57 Views
Dock
This is a migrated thread and some comments may be shown as answers.
Priya
Top achievements
Rank 1
Priya asked on 15 Oct 2008, 11:58 AM
Sir
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

 

2 Answers, 1 is accepted

Sort by
0
Priya
Top achievements
Rank 1
answered on 16 Oct 2008, 05:26 AM
any idea...
0
Stanimir
Telerik team
answered on 20 Oct 2008, 10:37 AM
Hello Priya,

I was not able to reproduce the problem with the code that you posted. Please, send us more detailed example - once we receive it we will do our best to help.


Sincerely yours,
Stanimir
the Telerik team

Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Tags
Dock
Asked by
Priya
Top achievements
Rank 1
Answers by
Priya
Top achievements
Rank 1
Stanimir
Telerik team
Share this question
or