Changing the Nodes Font Color at Runtime

1 reply. Last post: March 7, 2016 8:41 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 11:12 PM.
Previous Next