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

Custom title controls with itemplate

1 Answer 59 Views
This is a migrated thread and some comments may be shown as answers.
Top achievements
Rank 1
Johnathan asked on 27 Sep 2010, 01:36 PM

I have several dynamically created dock windows and I want to add a hyperlinks into the titlebar. I've been trying to implent and itemplate class but not getting on that well..

As it stands heres what I have which does not seem to display anything in the titlebar
Function CreateRadDock(ByVal ItemType As Integer, ByVal itemid As Integer, ByVal DashItemId As Integer, ByVal row As Integer, ByVal title As String) As Telerik.Web.UI.RadDock
        Dim Placeholder As New PlaceHolder
        Dim dock As New RadDock()
        dock.DockMode = DockMode.Docked
        dock.ID = DashItemId.ToString
        dock.Title = title
        dock.Width = Unit.Percentage(100)
        dock.Height = Unit.Pixel(335)
        dock.AutoPostBack = True
        Dim titleBarTemplate = New DockTitleTemplate

..... etc

Do I need to call and add method to add the title bar template here?
Class DockTitleTemplate
    Implements ITemplate
    Public Sub InstantiateIn(ByVal container As Control) Implements ITemplate.InstantiateIn
        Dim link1 As New HyperLink()
        link1.ID = "link1"
        link1.Text = "my linke text"
        link1.NavigateUrl = "#"
    End Sub
End Class

Currently this appears to do nothing and does not show my hyperlink in the titlebar. Your help or links to examples would be great. - Thanks..


1 Answer, 1 is accepted

Sort by
Telerik team
answered on 30 Sep 2010, 01:30 PM
Hi Johnathan,

Here is an example on how to dynamically add a link element to the titlebar of RadDock:

    Private Function CreateRadDock() As RadDock
        Dim dock As New RadDock()
        dock.ID = String.Format("RadDock1")
        dock.Title = String.Format("Dock")
        dock.Text = String.Format("Added at {0}", DateTime.Now)
        dock.UniqueName = Guid.NewGuid().ToString()
        dock.Width = Unit.Pixel(300)
                Dim link1 As New HyperLink()
        link1.ID = "link1"
        link1.Text = "my linke text"
        link1.NavigateUrl = "#"

        Return dock
    End Function
    Protected Sub Button1_Click(ByVal sender As Object, ByVal e As EventArgs) Handles Button1.Click
        Dim dock As RadDock = CreateRadDock()
    End Sub

Best wishes,
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
Asked by
Top achievements
Rank 1
Answers by
Telerik team
Share this question