Change Web treeview Node Text Color at Runtime

1 reply. Last post: March 7, 2016 3:54 AM by Erwin Sanders
Tags :
  • New Discussion
  • New Question
  • New Product Feedback

Hi,

I need to change the color of Intersoft treeview nodes at runtime base of certain condition.

I tried to attach my css class on WebTreeView1_InitializeNode as below but it is not working.

protected void WebTreeView1_InitializeNode(object sender, WebTreeViewNodeEventArgs e)

    {

        WebLoanDesignerRow WebLoanRow = (WebLoanDesignerRow)e.Node.Value;        

        switch (WebLoanRow.Level)

        {

            case (int)TreeViewSelectedLevel.Type:

            default:

                if (WebLoanRow.Enabled == (int)NodeEnabled.Enabled)

                    e.Node.CustomStyle = "SetRedColor";

                break;

}

Please let me know how CustomStyle property works. and how do i able to change node color at runtime.

Also if I try to override the node text by below code then color is changing at runtime but nodes are not being selectable anymore.

                    e.Node.Text = "<font color='red'>" + e.Node.Text + "</font>";

Please reply me ASAP.
All times are GMT -5. The time now is 8:13 PM.
Previous Next