Treeview data binding and menu

3 posts, 0 answers
  1. yoav roytenberg
    yoav roytenberg avatar
    1 posts
    Member since:
    Jan 2010

    Posted 24 Jan 2010 Link to this post


    Working with treeview I encountered some problems:

    1. How can i override the default context menu methods (like add and delete)
    2. My data structure is a decision tree made out of nodes, where each node has child nodes in an array. Is there an elegant way
       to bind my data structure with the tree view?
  2. Victor
    Victor avatar
    1358 posts

    Posted 25 Jan 2010 Link to this post

    Hello yoav roytenberg,

     Thank you for writing.

    The standard RadTreeView context menu can not be overridden, but it can be replaced with your own. For example:

    RadContextMenuManager mgr = new RadContextMenuManager();
    RadContextMenu menu = new RadContextMenu();
    menu.Items.Add(new RadMenuItem("Asdf"));
    menu.Items.Add(new RadMenuItem("Zxcv"));
    menu.Items.Add(new RadMenuItem("Qwer"));
    mgr.SetRadContextMenu(this.radTreeView1, menu);


    You can bind to a hierarchy of custom objects (nodes in your case) by setting a data relation. Please refer to the online documentation for doing so.

    Write again if you have other questions.

    Best wishes,
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
  3. Stefan
    Stefan avatar
    2911 posts

    Posted 22 Mar 2011 Link to this post

    Hello yoav roytenberg,

    Please note that in Q1 2011 we have introduced a major upgrade of RadTreeView control, which is now virtualized and fully customizable. Feel free to download the latest release and try it out. For more information on our latest release refer to this blog post.

    the Telerik team
Back to Top