How to Change RadTreeNode Back Color?

2 posts, 0 answers
  1. D.SRINIVASA
    D.SRINIVASA avatar
    34 posts
    Member since:
    Oct 2010

    Posted 19 Jul 2011 Link to this post

    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
  2. Plamen
    Admin
    Plamen avatar
    3047 posts

    Posted 22 Jul 2011 Link to this post

    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!

Back to Top