Hi,
I am binding RadTreeView dynamically like this ..
Here TreeViewCheckbox is my class is defined like this ..
How can I add attributes to every node ? please help me on this..
Thanks in advance..
I am binding RadTreeView dynamically like this ..
Dim siteData As New List(Of TreeViewCheckbox)()
tvChkSearchResult.Attributes.Clear()
If dt IsNot Nothing AndAlso dt.Rows.Count > 0 Then
siteData.Add(New TreeViewCheckbox(1, 0, "Select All"))
Dim i As Integer = 0
Do While (i < dt.Rows.Count)
Dim row As DataRow = dt.Rows(i)
Dim srColumn As String = row(searchedColumn)
i = (i + 1)
siteData.Add(New TreeViewCheckbox(i + 1, 1, srColumn))
Loop
End If
tvChkSearchResult.DataTextField = "Text"
tvChkSearchResult.DataFieldID = "ID"
tvChkSearchResult.DataFieldParentID = "ParentID"
tvChkSearchResult.DataSource = siteData
tvChkSearchResult.CausesValidation = False
tvChkSearchResult.DataBind()
Here TreeViewCheckbox is my class is defined like this ..
Public Class TreeViewCheckbox
Private _text As String
Private _id As Integer
Private _parentId As Integer
Public Property Text() As String
Get
Return _text
End Get
Set(ByVal value As String)
_text = value
End Set
End Property
Public Property ID() As Integer
Get
Return _id
End Get
Set(ByVal value As Integer)
_id = value
End Set
End Property
Public Property ParentID() As Integer
Get
Return _parentId
End Get
Set(ByVal value As Integer)
_parentId = value
End Set
End Property
Public Sub New(ByVal id As Integer, ByVal parentId As Integer, ByVal text As String)
_id = id
_parentId = parentId
_text = text
End Sub
End Class
How can I add attributes to every node ? please help me on this..
Thanks in advance..