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

Dynamic RadDock

2 Answers 159 Views
Dock
This is a migrated thread and some comments may be shown as answers.
nil
Top achievements
Rank 1
nil asked on 10 Jul 2007, 08:35 AM
hi Every1,
                 how to create dynamic RadDock without any event of Raddock layout and Raddockzone,i used only RadDockZone and RadDockLayout in .ascx page while creating new raddock in .asccx.vb file.please give an example which uses values from Database not session

2 Answers, 1 is accepted

Sort by
0
Petya
Telerik team
answered on 10 Jul 2007, 08:48 AM
Hi nil,

We would like to ask you for a detailed explanation on your example and also the reason why you do not want to use any events of RadDockLayout and RadDockZone. Once you provide us with your requirements we will advise you on how to build your project.

Greetings,
Petya
the Telerik team

Instantly find answers to your questions at the new Telerik Support Center
0
nil
Top achievements
Rank 1
answered on 10 Jul 2007, 09:00 AM
Actually i converted raddocks control into promotheus controls and my .ascx code is here==>
      

<telerik:RadDockLayout ID="dockManagerMain" runat="server" >

<telerik:RadDockZone ID="songsDockZone" runat="server" Width="100%" MinHeight="700px"

BackColor="Transparent">

</telerik:RadDockZone>

</telerik:RadDockLayout>


and my ascx.vb file is here==>

Private Sub Page_Init(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Init

'CODEGEN: This method call is required by the Web Form Designer

'Do not modify it using the code editor.

InitializeComponent()

BindSongs()

End Sub

#End Region

Private m_UserID As Integer = -1

Public Property UserID() As Integer

Get

If m_UserID = -1 Then

m_UserID = SecurityMaint.Instance.CurrentUserID

End If

Return m_UserID

End Get

Set(ByVal Value As Integer)

m_UserID = Value

End Set

End Property

 

Private Sub BindSongs()

Dim hsh As New Hashtable

hsh.Add("@UserID", UserID)

Dim ds As New DataSet

Dim dv As New DataView

Dim da As New SqlDataAdapter(myHitFactory.DataAccess.GetDataCommand("sp_MyBasket", hsh))

da.Fill(ds)

Dim index As Integer = 0

For Each row As DataRow In ds.Tables(0).Rows

Dim ctrl As BasketSong = LoadControl("../Controls/BasketSong.ascx")

ctrl.SongData = row

Dim dockableObject As New RadDock

dockableObject.UniqueName = Guid.NewGuid.ToString

dockableObject.ID = "dock" + index.ToString()

dockableObject.ContentContainer.Controls.Clear()

dockableObject.ContentContainer.Controls.Add(ctrl)

dockableObject.DockMode = DockMode.Docked

dockableObject.DockHandle = DockHandle.TitleBar

dockableObject.EnableDrag = True

dockableObject.Enabled = True

dockableObject.Height = New Unit(60)

dockableObject.Width = New Unit(100, UnitType.Percentage)

songsDockZone.Controls.Add(dockableObject)

dockableObject.Commands.Add(New DockCloseCommand())

dockableObject.Commands.Add(New DockExpandCollapseCommand())

'songsDockZone.Docks.Add(dockableObject)

index = index + 1

next
end sub
Problem==>in my .aspx page using this above usercontrols many songs appears and now i have to docking and ordering/reordering that songs (user can do this) but docking and ordering/reordering is not working
 
Tags
Dock
Asked by
nil
Top achievements
Rank 1
Answers by
Petya
Telerik team
nil
Top achievements
Rank 1
Share this question
or