Yak

4 posts, 0 answers
  1. Yak
    Yak avatar
    4 posts
    Member since:
    May 2012

    Posted 27 Jul 2012 Link to this post

    Hai All
    How to create one Treeview with Folders by Clicking button 
  2. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 27 Jul 2012 Link to this post

    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
  3. DevCraft banner
  4. Yak
    Yak avatar
    4 posts
    Member since:
    May 2012

    Posted 31 Jul 2012 Link to this post

    thanks for the reply but my q is by clicking button click it will generate one folder in treeview..
  5. Lancelot
    Lancelot avatar
    251 posts
    Member since:
    Jul 2012

    Posted 31 Jul 2012 Link to this post

    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
Back to Top