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

How to create Custom Node Element in TreeView?

1 Answer 116 Views
Treeview
This is a migrated thread and some comments may be shown as answers.
Myat Su
Top achievements
Rank 1
Myat Su asked on 18 Nov 2011, 03:01 AM
Hello,
I want to show large image in tree node and create border for node.
So I think, I need to create treeview custom node, am I right?
Please give me advice how to do, create custom node and do other things?

Please help me,
Thank you so much.
Myat Su

1 Answer, 1 is accepted

Sort by
0
Stefan
Telerik team
answered on 22 Nov 2011, 04:08 PM
Hello Myat Su,

Thank you for writing.

In order to show nodes with bigger images, simply set the desired image to Image property of the desired node and then set the AutoSizeItems property of the TreeViewElement to true, so the nodes will be sized according to their content.

In order to show borders around the nodes, set the top and bottom border colors of the NodeElement in the NodeFormatting event handler.

Attached you can find a sample project with the desired functionalities implemented. 

Let me know if you have any other questions.

Regards,
Stefan
the Telerik team

Q2’11 SP1 of RadControls for WinForms is available for download (see what's new); also available is the Q3'11 Roadmap for Telerik Windows Forms controls.

Tags
Treeview
Asked by
Myat Su
Top achievements
Rank 1
Answers by
Stefan
Telerik team
Share this question
or