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

Yak

3 Answers 79 Views
TreeView
This is a migrated thread and some comments may be shown as answers.
Yak
Top achievements
Rank 1
Yak asked on 27 Jul 2012, 09:05 AM
Hai All
How to create one Treeview with Folders by Clicking button 

3 Answers, 1 is accepted

Sort by
0
Lancelot
Top achievements
Rank 1
answered on 27 Jul 2012, 05:41 PM
Hi Yak,

Yes, you can dynamically create TreeViewItems programmatically. Here is a list of links to the help documentation that contains code examples and tutorials to get you started.

RadTreeView
Getting Started
Populating with data
TreeViewItem
Overview
Expanding and collapsing items
Load on demand

While you are in the documentation, look over to the left column and scroll down. Notice the expanded RadTreeView node, you will find other documentation that will be extremely helpful in there.

Good luck,
Lancelot
0
Yak
Top achievements
Rank 1
answered on 31 Jul 2012, 05:24 AM
thanks for the reply but my q is by clicking button click it will generate one folder in treeview..
0
Lancelot
Top achievements
Rank 1
answered on 31 Jul 2012, 02:16 PM
Hi Yak,

Ok, so then what you want to do is add a new item to the collection the RadTreeView is bound to. The RadTreeView will detect the change in the collection and then display the new item. Also, you are probably using hierarchical data, you'll want to make sure you add the folder at the proper level. 

For instance, here's an example of adding an item to an observable collection. This isn't a RadControls question but a Silverlight one.

This link will bring you to the documentation on the Add method for the ObservableCollection class

This link will bring you to an example of someone who added a new item to a collection.

Good luck,
Lancelot
Tags
TreeView
Asked by
Yak
Top achievements
Rank 1
Answers by
Lancelot
Top achievements
Rank 1
Yak
Top achievements
Rank 1
Share this question
or