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

Bold parent nodes in a databound radtreeview.

1 Answer 206 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Roger
Top achievements
Rank 1
Roger asked on 22 Apr 2016, 05:10 PM

I have a telerik:RadTreeNodeBinding within a telerik:RadComboBox.

Is there a way to format the parent node in bold text of a databound radtreeview?

Thanks,

Roger

 

 

1 Answer, 1 is accepted

Sort by
0
Roger
Top achievements
Rank 1
answered on 22 Apr 2016, 08:17 PM
 
I've found a solution:
Added the foreach code after the Databind(0.                
                radTreeView.DataTextField = "Text";
                radTreeView.DataValueField = "ID";
                radTreeView.DataFieldID = "ID";
                radTreeView.DataFieldParentID = "GroupIds";
                radTreeView.DataSource = siteData;
                radTreeView.DataBind();
                foreach (var itm in radTreeView.Nodes.Cast<RadTreeNode>().Where(itm => itm.Nodes.Count > 0))
                {
                    itm.Font.Bold = true;
                }
Tags
TreeView
Asked by
Roger
Top achievements
Rank 1
Answers by
Roger
Top achievements
Rank 1
Share this question
or