2 posts, 0 answers
  1. Chom
    Chom avatar
    56 posts
    Member since:
    Dec 2009

    Posted 30 Sep 2013 Link to this post


    I am having trouble trying to figure out the binding and I am not sure if it is possible.

    I have a base node with several child nodes and within those child nodes I need to add additional child nodes.

    I have managed to bind the first level child nodes, but I cannot figure out how to add the additional child nodes.

    Below is a sample.

    Thank you,

    IList<Project> project = new List<Project>();
    IList<Topic> topic = new List<Topic>();
    IList<Cloud> cloud = new List<Cloud>();
    IList<Trend> trend = new List<Trend>();
    IList<Schedule> schedule = new List<Schedule>();
    cloud.Add(new Cloud { Name = "cloud1" });
    cloud.Add(new Cloud { Name = "cloud2" });
    trend.Add(new Trend { Name = "trend 1" });
    trend.Add(new Trend { Name = "trend 2" });
    schedule.Add(new Schedule { Name = "sched 1" });
    schedule.Add(new Schedule { Name = "sched 2" });
    topic.Add(new Topic { Name = "Clouds", CloudAssociation = cloud });
    topic.Add(new Topic { Name = "Trends", TrendAssociation = trend });
    topic.Add(new Topic { Name = "Schedules", ScheduleAssociation = schedule });
    project.Add(new Project { Name = "My Project", TopicAssociation = topic });
    radTreeView1.DisplayMember = "Name\\Name\\Name";
    radTreeView1.ParentMember = "Project\\TopicAssociation";
    radTreeView1.ChildMember = "Project\\TopicAssociation\\CloudAssociation";
    radTreeView1.DataSource = project;
  2. Stefan
    Stefan avatar
    2911 posts

    Posted 03 Oct 2013 Link to this post

    Hi Chom,

    Thank you for writing.

    I have tested the code provided and it seems to be working fine on my end - please refer to the attached image.

    Basically, you have one Project, with the respective TopicAssociation containing CloudAssociation, TrendAssociation and ScheduleAssociation. Since you have set the ParentMember to be "Project\\TopicAssociation", you get one parent node (MyProject) with tree child nodes - Clouds, Trends and Schedules. 

    Then you set the ChildMember to "Project\\TopicAssociation\\CloudAssociation" and the tree loads the data for from the CloudAssociation as child nodes for the Cloud node. 

    If I understand correctly, you would like that all three child nodes - Clous, Trend and Scheduler to have their child nodes. To achieve this, you should use the Load on demand feature of RadTreeView. For more information about it please refer to the following article:

    I hope that you find this information useful.

    Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
    Sign up for Free application insights >>
Back to Top