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

How to Change RadTreeNode Back Color?

1 Answer 89 Views
ComboBox
This is a migrated thread and some comments may be shown as answers.
D.SRINIVASA
Top achievements
Rank 2
D.SRINIVASA asked on 19 Jul 2011, 10:50 AM
Hi,

i am Srinivas

In my project i have a RadTreeView to displays a nodes form Backend database. it shown in first attachment. Here i want to change the node back color based on the condition. it was executed successfully at first time when i expand the parent node. there after when i check on the  node then it displays the data in RadGrid successfully but it removes the Node BackColor automatically.  it shown in second attachment.

The following is the code for Change the Node Back Color.

Protected Sub RadTreeView1_PreRender(ByVal sender As Object, ByVal e As System.EventArgs) Handles RadTreeView1.PreRender
    If Session("parentnode") Is Nothing Then
    Else
         Dim data As DataTable = GetChildNode(Session("parentnode").ToString())
        For Each row As DataRow In data.Rows
       Dim node As New RadTreeNode()
       If row("job_status").ToString() = "NS" Then
      node.BackColor = Color.LightSkyBlue
End If
Next

Please Help me

Thank You
D.Srinivas

1 Answer, 1 is accepted

Sort by
0
Plamen
Telerik team
answered on 22 Jul 2011, 12:29 PM
Hello D.Srinivasa,

We tried to reproduce the problem but didn't observe the same behaviour. It seems that when you check the node you somehow override this behaviour. You may try to set the color once again in the onNodeCheck or onNodeExpand event.

All the best,
Plamen Zdravkov
the Telerik team

Register for the Q2 2011 What's New Webinar Week. Mark your calendar for the week starting July 18th and book your seat for a walk through of all the exciting stuff we will ship with the new release!

Tags
ComboBox
Asked by
D.SRINIVASA
Top achievements
Rank 2
Answers by
Plamen
Telerik team
Share this question
or