Hi,
How to change fore color for specific node ? i have 3 level node and want to change fore color for 3rd level node only, below the code i used but not color not changed.
Private Sub RadButton1_Click(sender As Object, e As EventArgs) Handles RadButton1.Click
Dim filePath As String = "20230824.124217\20230824.1242174616\00001.tif" Dim filenode As String() = filePath.Split("\") Dim addNode As String = "" For i = 0 To filenode.Count - 1 If addNode = "" Then addNode = filenode(i) Else addNode = addNode & "\" & filenode(i) End If Dim searchKey As String = addNode Dim nodeExists As Boolean = CheckNodeExists(RadTreeView1.Nodes, searchKey) If Not nodeExists Then RadTreeView1.ForeColor = Color.Red Dim folderNode As RadTreeNode = New RadTreeNode() folderNode.ForeColor = System.Drawing.Color.Green RadTreeView1.AddNodeByPath(addNode) End If Next RadTreeView1.Update() RadTreeView1.Refresh()
End Sub
Private Function CheckNodeExists(nodes As RadTreeNodeCollection, searchKey As String) As Boolean
For Each node As RadTreeNode In nodes
If node.FullPath = searchKey Then
' Node found
Return True
End If
' Recursively check child nodes
If node.Nodes.Count > 0 Then
If CheckNodeExists(node.Nodes, searchKey) Then
Return True
End If
End If
Next
' Node not found
Return False
End Function
Pls reply asap.
Thanks and Regards
Aravind