RadTreeView - Problem when is applied filter

3 posts, 1 answers
  1. Henrique
    Henrique avatar
    2 posts
    Member since:
    Dec 2014

    Posted 19 Jan 2017 Link to this post

    Dear Support Team,

    We are using a RadTreeView and we found a problem.

    When is applied the filter with some text and after is deleted the filter text,
    the 'status mode' of some nodes is changed getting the wrong state.

    Please run the attached program and following the steps below:

    1- Uncheck some child nodes
    2- Apply the filter with some text
    3- Delete filter text

    How can we solve this issue? Could you advise?

    Thanks in advance!

    Best regards,

    Maurer
  2. Henrique
    Henrique avatar
    2 posts
    Member since:
    Dec 2014

    Posted 19 Jan 2017 in reply to Henrique Link to this post

    Code bellow:

     

    using System;
    using System.Collections.Generic;
    using System.Windows.Forms;
    using Telerik.WinControls.Enumerations;
    using Telerik.WinControls.UI;

    namespace RadTreeViewFiltredTest
    {
        public partial class Form1 : Form
        {
            public Form1()
            {
                InitializeComponent();
            }

           
            private void Form1_Load(object sender, EventArgs e)
            {

                radTreeView1.CheckBoxes = true;
                radTreeView1.TriStateMode = true;

                var rootNode = new RadTreeNode("Root Node");
                
                radTreeView1.Nodes.Add(rootNode);

                // Create two parent nodes
                var parentNode1 = new RadTreeNode("First Parent");
                var parentNode2 = new RadTreeNode("Second Parent");

                // Add the parent nodes to tree view's nodes collection
                rootNode.Nodes.AddRange(parentNode1, parentNode2);
                
                
                // Create a child node
                var radTreeNodes2 = new List<RadTreeNode>
                {
                    new RadTreeNode("nA.1"),
                    new RadTreeNode("nB.2"),
                    new RadTreeNode("nC.3"),
                    new RadTreeNode("nD.4"),
                    new RadTreeNode("nE.5"),
                };
                
                var radTreeNodes = new List<RadTreeNode>
                {
                    new RadTreeNode("nA.1"),
                    new RadTreeNode("nB.2"),
                    new RadTreeNode("nC.3"),
                    new RadTreeNode("nD.4"),
                    new RadTreeNode("nE.5"),
                };
                
                // Add the child node to the first parent's nodes collection
                parentNode1.Nodes.AddRange(radTreeNodes);
               
                // Remove the child from the first parent collection and add it to the second parent nodes collection
                //parentNode1.Nodes.Remove(childNode);
                parentNode2.Nodes.AddRange(radTreeNodes2);
                rootNode.ExpandAll();
                rootNode.Checked = true;

            }

            private void textBox1_TextChanged(object sender, EventArgs e)
            {
                radTreeView1.Filter = textBox1.Text;

                if(radTreeView1.TopNode != null)
                    radTreeView1.TopNode.ExpandAll();
            }
        }
    }

  3. Answer
    Hristo
    Admin
    Hristo avatar
    1522 posts

    Posted 23 Jan 2017 Link to this post

    Hello Henrique,

    Thank you for writing.

    Indeed the observed behavior is not correct and I have logged an issue on our feedback portal, here: FIX. RadTreeView - incorrect check state when the control is in TriState and applying a filter. I have also added a vote for it on your behalf, as well as I have updated your Telerik points. Additionally, you can subscribe to the item and be updated with all of its status changes.

    The item is already in development and the fix will be made publicly available with our next official release.

    I hope this helps. Should you have further questions please do not hesitate to write back.

    Regards,
    Hristo
    Telerik by Progress
    Try our brand new, jQuery-free Angular 2 components built from ground-up which deliver the business app essential building blocks - a grid component, data visualization (charts) and form elements.
Back to Top