Hi,
I'm able to get the samples to work but I'm having trouble adding to my project. It seems that TreeViewElement_CreateNodeElement isn't firing.
Can anyone see what I might be missing? The code below just needs a radtreeview named tvProjectPath.
Thanks in advance!!
Imports Telerik.WinControls.UI
Public Class RadForm1
Private Sub RadForm1_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim rtvTest As Telerik.WinControls.UI.RadTreeView = tvProjectPath
Dim DFSRootNode As New RadTreeNode("Root0")
Dim ProdDataNode As New RadTreeNode("Child1")
Dim JobsNode As New RadTreeNode("Child2")
Dim ProjectRoot As New RadTreeNode("Child3")
'Dim ProjectFolder As New CustomTreeNodeElement()
tvProjectPath.Nodes.Add(DFSRootNode)
DFSRootNode.Nodes.Add(ProdDataNode)
ProdDataNode.Nodes.Add(JobsNode)
JobsNode.Nodes.Add(ProjectRoot)
'ProjectRoot.TreeViewElement =
End Sub
Private Sub CustomNodes_Load(sender As Object, e As EventArgs) Handles Me.Load
Dim test As String = ""
Me.tvProjectPath.ExpandAll()
End Sub
Private Sub TreeViewElement_CreateNodeElement(sender As Object, e As Telerik.WinControls.UI.CreateTreeNodeElementEventArgs)
e.NodeElement = New CustomTreeNodeElement()
End Sub
End Class
Public Class CustomContentElement
Inherits TreeNodeContentElement
Private nodeContentContainer As StackLayoutElement
Private nodeLabel As RadLabelElement
Private nodeTextBox As RadTextBoxControlElement
Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
Get
Return GetType(TreeNodeElement)
End Get
End Property
Protected Overrides Sub InitializeFields()
MyBase.InitializeFields()
Me.StretchHorizontally = True
End Sub
Protected Overrides Sub CreateChildElements()
MyBase.CreateChildElements()
nodeContentContainer = New StackLayoutElement
nodeContentContainer.Orientation = Orientation.Horizontal
nodeContentContainer.StretchHorizontally = True
nodeContentContainer.StretchVertically = False
nodeLabel = New RadLabelElement
Me.Children.Add(nodeLabel)
nodeTextBox = New RadTextBoxControlElement
Me.Children.Add(nodeTextBox)
End Sub
End Class
Public Class CustomTreeNodeElement
Inherits TreeNodeElement
Protected Overrides Function CreateContentElement() As TreeNodeContentElement
Return New CustomContentElement()
'Dim node As RadTreeNode = Me.Data
End Function
Protected Overrides ReadOnly Property ThemeEffectiveType() As Type
Get
Return GetType(TreeNodeElement)
End Get
End Property
End Class