Show CheckedNodes in RadTreeview

5 posts, 0 answers
  1. Mahesh
    Mahesh avatar
    7 posts
    Member since:
    Nov 2011

    Posted 21 Jan 2012 Link to this post

    Hi,
          I am using one RadTreeview control with CheckBoxes. I want to show the CheckedNodes in another RadTreeview control.

    Can someone please help me out ASAP?

    Thanks,
    Mahesh
  2. Mahesh
    Mahesh avatar
    7 posts
    Member since:
    Nov 2011

    Posted 22 Jan 2012 Link to this post

    Any update plz?
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Jayesh Goyani
    Jayesh Goyani avatar
    2732 posts
    Member since:
    May 2010

    Posted 22 Jan 2012 Link to this post

    Hello Mahesh,

    TreeView / CheckBox Support

    Thanks,
    Jayesh Goyani
  5. Mahesh
    Mahesh avatar
    7 posts
    Member since:
    Nov 2011

    Posted 22 Jan 2012 Link to this post

    Hi Jayesh,
                      Thanks for the replay, I have seen this example already and developed my app based on this demo only. 

    My problem is after getting "treeView1.CheckedNodes" into IList<RadTreeNode> object as below

    IList<RadTreeNode> nodeCollection = treeView1.CheckedNodes; 

    Then i am trying to add this collection object into my second treeview as a preview  when click on button(preview)

    foreach (RadTreeNode node in nodeCollection)
    {
        if(node.ParentNode.Text == "SomeText")   // All CheckedNodes have been updated in my 2nd treeview(preview) when i add root node of the first treeview so that here i break the loop after adding root node.

          {
    treeView2.Nodes.add(node);
    break; } }

    treeView2.ExpendAllNodes(); 


    Actual problem:
        My second treeview(preview) is updating when i was checked some nodes from first treeview and click on preview button...Its OK. But if I make some changes in the checkbox selection in the first treeview then click preview button it was not showing actual selection..its only showing 1st time checkedNodes only.


    Hope you understand my problem. Please let me know if any questions.

    Thanks,
    Mahesh


  6. Princy
    Princy avatar
    17421 posts
    Member since:
    Mar 2007

    Posted 10 Oct 2012 Link to this post

    Hi Mahesh,

    Here is the sample code that I tried based on your scenario which works as expected.

    C#:
    protected void Preview_Click(object sender, EventArgs e)
    {
     RadTreeView2.Nodes.Clear();
     IList<RadTreeNode> nodeCollection = RadTreeView1.CheckedNodes;
     foreach (RadTreeNode node in nodeCollection)
     {
       RadTreeNode newNode = new RadTreeNode(node.Text);
       RadTreeView2.Nodes.Add(newNode);
     }
    }

    Thanks,
    Princy.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017